2013年6月9日

Best practices for Exception Handling

摘要: public void consumeAndForgetAllExceptions(){ try { ...some code that throws exceptions } catch (Exception ex){ ex.printStacktrace(); }}一旦异常被抛出,正常程序执行将被挂起并且控制权将被转向catch块,catch块捕获异常后仅仅抑制它,catch块执行之后继续程序的执行,好像什么事情都没有发生。public void someMethod() throws Exception{}空的函数体怎么能抛出一个异常呢?Ja... 阅读全文

posted @ 2013-06-09 22:04 Knuth_档案 阅读(157) 评论(0) 推荐(0) 编辑

导航