样例1:

 public class Test{
public static String output = "";
public static void foo(int i){
try{
if(i == 1){
throw new Exception();
}
}catch(Exception e){
output += "2";
return ;
}finally{
output += "3";
}
output += "4";
} public static void main(String[] args){
foo(0);
foo(1);
System.out.println(output);
}
}

输出:3423

说明:try之后并定执行finally,finally如果没有返回,则会继续执行下面的代码

样例2:

 public class Test{
public static String output = "";
public static void foo(int i){
try{
if(i == 1){
throw new Exception();
}
}catch(Exception e){
output += "2";
}finally{
output += "3";
}
output += "4";
} public static void main(String[] args){
foo(0);
foo(1);
System.out.println(output);
}
}

输出:34234

最新文章

  1. 配置nginx好了,html能打开,index.php打不开?
  2. 【问题&解决】试用版SQL Server 2008 R2 提示评估期已过,数据库不能访问解决办法
  3. 最长回文子串Manacher算法模板
  4. java的重修之路
  5. JavaScript中定时器
  6. Android4.2.2的Stagefright维护编解码器的数据流
  7. Bzoj1479: [Nerrc1997]Puncher打孔机
  8. 二分查找c++简单模板
  9. js 原型规则与示例
  10. LongAdder基础
  11. Highgo 瀚高数据库的简单搭建以及处理参数等.
  12. LOJ2250 [ZJOI2017] 仙人掌【树形DP】【DFS树】
  13. MySQL最优配置模板( 5.6&5.7)(运维那点事)
  14. S5PV210 PWM定时器
  15. LSTM介绍
  16. BZOJ4239 : 巴士走读
  17. linux常用命令:du 命令
  18. Kindle一周使用感受
  19. 17monipdb.dat
  20. maven 服务器搭建 -- nexus

热门文章

  1. 自定义 Preference Header 布局
  2. Jade学习笔记
  3. MySQL简单查询
  4. 关于mobiscroll插件的使用
  5. 记录使用Hibernate查询bean中字段和数据库列类型不匹配问题
  6. 批处理SQL语句
  7. cf C. Matrix
  8. BZOJ1532: [POI2005]Kos-Dicing
  9. struct2(二) struct2的hello world 程序
  10. win8开机密码忘了怎么办