java 丢失的异常
2024-09-13 02:17:46
采用finally从句中的,可能会丢失异常
package thinking; //: LostMessage.java // How an exception can be lost class VeryImportantException extends Exception { public String toString() { return "A very important exception!"; } } class HoHumException extends Exception { public String toString() { return "A trivial exception"; } } public class LostMessage { void f() throws VeryImportantException { throw new VeryImportantException(); } void dispose() throws HoHumException {throw new HoHumException();} public static void main(String[] args) throws Exception { LostMessage lm = new LostMessage(); try { lm.f(); } finally { lm.dispose(); } } } ///:~
VeryImportantException 被finally从句中的HoHumException的异常替代了,即出错信息丢失了。
最新文章
- 【Knockout.js 学习体验之旅】(2)花式捆绑
- 在windows系统下,在终端快速打开某个路径
- Class.forName(";com.mysql.jdbc.Driver";) ;
- 如何在Delphi里面查看程序的汇编代码?
- Python基础(二)之集合
- windows下socket学习(一)
- 限制EditText只能输入小数点后两位
- Unity4.5版本DLL库名字问题
- php单引号、双引号与数据库
- CoreJava_线程并发(堵塞队列):在某个目录下搜索含有某keyword的文件
- C#—委托分析
- 写自己的第二级处理器(3)——Verilog HDL行为语句
- 权限开发 spring security 3.0.7 序列1 数据库脚本
- Java EE基础之JSP
- 关于Java中Arrays.sort()方法TLE
- memcache 启动 failed to start
- PostGis常用函数中文介绍
- svn的使用技巧
- springboot~openfeign从此和httpClient说再见
- react rem
热门文章
- iOS多线程编程(四)------ GCD(Grand Central Dispatch)
- javascript判断一个变量或对象是否存在
- vc6.0的一些快捷键
- bashdb bashdebug
- C.Candy
- Windows下VMware虚拟机使用Centos,Docker方式安装openstf的小坑
- Configuring Your EMS Server or EMS Console Server on Windows/Linux
- 一步一步学Silverlight 2系列(29):使用Transform实现更炫的效果(上)
- docker hub下载慢解决方法 使用daocloud的mirror
- 黑客技术 —— Linux 命令行