Try Catch Finally
来源:互联网 发布:上海菜鸟网络工资多少 编辑:程序博客网 时间:2024/04/27 17:15
- 代码
public class TryCatchFinally { public void function(boolean ex) { try { System.out.println("try start"); if (ex) { throw new NullPointerException(); } System.out.println("try end"); } catch (Exception e) { System.out.println("catch"); } finally { System.out.println("finally"); } } public static void main(String[] args) { TryCatchFinally test=new TryCatchFinally(); System.out.println("抛出异常:"); test.function(true); System.out.println("不抛出异常:"); test.function(false); }}
- 输出
0 0
- try..catch..finally
- try-catch-finally
- Try-catch-finally机制
- 关于try-catch-finally
- C# try catch finally
- try...catch...finally
- try catch finally用法
- Try ---Catch----Finally
- try...catch... finally
- try....catch...finally 妙用
- try{} catch(){}finally{}执行
- Try Catch Finally
- try-catch-finally
- C# try, catch ,finally
- try catch finally
- try catch finally
- try-catch-finally
- try...catch...finally
- Git 分支管理和冲突解决
- jquery中的html()及.text()和.val()的区别
- HDU 4501 小明系列故事——买年货(三重背包)
- 编程之美快速寻找满足条件的两个数
- 重建二叉树java
- Try Catch Finally
- 第89课程 Spark STREAMING kafka 安装!
- 协议的基本概念
- NUMA
- stack堆栈容器
- 20160423 Oracle数据库中中文显示问号的解决办法
- 宏定义
- Ubuntu16.04安装flash方式
- #leetcode#235 Lowest Common Ancestor of a Binary Search Tree