?? throwsdemo.java
字號:
import java.io.*;
public class ThrowsDemo {
void throw1() throws FileNotFoundException
{
throw new FileNotFoundException ( "excp1" );
}
void throw2() throws Exception
{
try {
System.out.println( "Call method throw1" );
throw1();
}
catch ( Exception e ) {
System.out.println( "Caught in throw2:" + e );
throw e;
}
}
public static void main( String args[] )
{
ThrowsDemo app = new ThrowsDemo();
try {
System.out.println( "Call method throw2" );
app.throw2();
}
catch ( Exception e ) {
System.out.println( "Caught in main:" + e );
}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -