JAVA代码中加了Try...Catch的执行顺序

public static String getString(){
try {
//return "a" + 1/0;
return "a";

} catch (Exception e) {
System.out.println(1);
return "b";
// TODO: handle exception
}finally{
System.out.println(2);
return "c";
}
}

 

请问输出多少?答案也许会让你大吃一惊哦

posted on 2016-07-26 09:53  jiahuafu  阅读(702)  评论(0编辑  收藏  举报

导航