package yichang;
public class Question {
public static void func()throws Exception{//为什么不加throws Exception 就编译错误?
try{
throw new Exception();
}
finally{
System.out.println("B");
}
}
public static void main(String[] args) {
try{
func();
System.out.println("A");
}
catch (Exception e) {
// TODO: handle exception
System.out.println("C");
}
System.out.println("D");
}
} |
|