该博文通俗易懂,有条理,值得阅读。
#1 Exception definition
#2 Throwable --> Error + Exception (unchecked and checked)
#3 How do using excetion
# try ... catch
# re-throw the excetion
# exception chain
# finally
# Bad practice
-----------End 1 -------------
2. Java 异常的分类 (被架构师问的面试题)
Note: #1 Java 异常处理流程
#2 处理RuntimeException的原则是:如果出现RuntimeException,那么一定是程序员的错误。
下面作者将介绍界中使用异常的最佳实践(Best Practices for Using Exceptions)
1. 总是要做一些清理工作(Always clean up after yourself)
2. 不要使用异常来控制流程(Never use exceptions for flow control)
3. 不要忽略异常
4. 不要捕获顶层的Exception
5. Log exceptions just once
4. Java API
java.lang
Class Throwable
5. Java specification language