?? trycatch.java
字號:
//trycatch.java
public class trycatch {
// execute application
public static void main( String args[] )
{
// call method1
try {
method1();
}
// catch Exceptions thrown from method1
catch ( Exception exception ) {
System.err.println( exception.getMessage() + "\n" );
exception.printStackTrace();
}
}
// call method2; throw exceptions back to main
public static void method1() throws Exception
{
method2();
}
// call method3; throw exceptions back to method1
public static void method2() throws Exception
{
method3();
}
public static void method3() throws Exception
{
throw new Exception("Exception thrown in method3");
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -