类结构:
image.pngThe Throwable class is the superclass of all errors and exceptions in the Java language. Only objects that are instances of this class (or one of its subclasses) are thrown by the Java Virtual Machine or can be thrown by the Java throw statement.
Java provides three kinds of throwables:
checked exceptions,:except runtime exceptions: Errors
runtime exceptions: is the superclass of those exceptions that can be thrown during the normal operation of the Java Virtual Machine.
Errors.: a subclass of Throwable that indicates serious problems that a reasonable application should not try to catch. Most such errors are abnormal conditions.
Errors and runtime exceptions and compile-time checking of exceptions
grammar:
Try {
}catch(...){
}finally(
)
Exception chain 异常链:
以一个异常对象为参数构造新的异常对象。新的异对象将包含先前异常的信息
Customer exception 自定义异常:拓展exception
Eg: IoException
image.png
网友评论