Q: Throable是不是受查异常?
A: 是
在 Java规范 中,对非受查异常和受查异常的定义是这样的:
- The unchecked exception classes are the
run-time
exception classes and the error
classes.
- The checked exception classes are all exception classes other than the unchecked exception classes . That is, the checked exception classes are Throwable and all its subclasses other than RuntimeException and its subclasses and Error and its subclasses.
也就是说,除了 run-time exception
和其子类,以及 error
和其子类,其它的所有异常都是受查异常。
Java中的异常分类如下:
Error
RuntimeException
受查异常
本文永久更新链接地址: https://www.linuxidc.com/Linux/2018-05/152533.htm
原文
https://www.linuxidc.com/Linux/2018-05/152533.htm