问输出结果,
public class Test {
public static void main(String[] args){
int num = 1;
System.out.println("main:\t"+method(num));
}
private static int method(int num) {
num++;
try{
return ++num;
} finally {
num++;
System.out.println("method:\t"+num);
}
}
}
输出:
method: 4
main: 3