java 基础练习题

10.输出内容是什么?

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[] arg){
foo(0);
System.out.println(output);
foo(1);
System.out.println(output);

}
}

答案:134,13423

posted @ 2018-07-04 21:08  仙人掌的成长  阅读(83)  评论(0编辑  收藏  举报