首页 > 编程语言 > 详细

java 基础练习题

时间:2018-07-04 21:20:42      阅读:155      评论:0      收藏:0      [点我收藏+]

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

java 基础练习题

原文:https://www.cnblogs.com/chzlh/p/9265335.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!