public class Test {
public static void main (String[] args) {
System.out.println( new Test().method() );
}
public int method(){
try{
return func1();
} finally {
return func2();
}
}
public int func1(){
System.out.println("func1");
return 1;
}
public int func2(){
System.out.println("func2");
return 2;
}
}
答案:func1
func2
2
为什么答案 不是
func1
1 |
|