【发布时间】:2014-12-11 14:10:59
【问题描述】:
我正在查看RuntTimeException 类,它没有在编译时检查。为什么一个类在编译时不是checked 而在运行时不是checked?
https://docs.oracle.com/javase/7/docs/api/java/lang/RuntimeException.html
| Throwable |
+-----------+
/ \
/ \
+-------+ +-----------+
| Error | | Exception |
+-------+ +-----------+
/ | \ / | \
\________/ \______/ \
unchecked checked
+------------------+
| RuntimeException |
+------------------+
/ | | \
\_________________/
unchecked
-
RuntimeExceptionclass 扩展Exceptionclass 并且仍然未选中?如何?。 - 编译器如何决定是否应在
runtime或compile时间检查此类?。
【问题讨论】:
标签: java exception exception-handling