?? rethrowing.java
字號:
//Demonstrating fillInStackTrace( )
public class Rethrowing
{ public static void f( ) throws Exception
{ System.out.println("在 f( ) 中發(fā)生一個異常");
throw new Exception("從 f( ) 中拋出的異常");
}
public static void g( ) throws Throwable
{ try
{ f( );}
catch(Exception e)
{ System.out.println("在 g( ) 中的異常路徑,e.printStackTrace( )");
e.printStackTrace( );
throw e;
}
}
public static void main(String args[ ]) throws Throwable
{ try
{ g( );}
catch(Exception e)
{ System.out.println("在主方法中捕捉到異常,e.printStackTrace( )");
e.printStackTrace( );
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -