下面代码输出的结果是:13423
public class test {
public static String output= "";
public static void foo(int i){
try {
if (i==1){
throw new Exception();
}
output+=1;
} catch (Exception e) {
output += 2;
return;
}
finally {
output += 3;
}
output +=4;
}
public static void main(String[] args) throws Exception {
// goWhere();
foo(0);
foo(1);
System.out.println(output);
}
}
断点查看,foo(0)执行为134,i=0无异常