62,614
社区成员
发帖
与我相关
我的任务
分享
import java.io.IOException;
class ExceptionTest {
public static void main(String args[]) {
try {
methodA();
} catch (IOException e) {
System.out.println("caught IOException");
} catch (Exception e) {
System.out.println("caught Exception");
return;
} finally {
System.out.println("catch one exception");
}
}
private static void methodA() throws IOException{
throw new IOException("error");
}
}