Which two statements correctly describe checked exception?

A. These are exceptional conditions that a well-written application should anticipate and recover from.
B. These are exceptional conditions that are external to the application, and that the application usually cannot anticipate or recover from.
C. These are exceptional conditions that are internal to the application, and that the application usually cannot anticipate or recover from.
D. Every class that is a subclass of RuntimeException and Error is categorized as checked exception.
E. Every class that is a subclass of Exception, excluding RuntimeException and its subclasses, is categorized as checked exception.

題解

選項 A,checked exception 在撰寫程式的時候一定要被處理,所以這個敘述是正確的。

選項 B,這是 Error 的敘述。

選項 C,這是 RuntimeException 的敘述。RuntimeException 為 unchecked exception。

選項 D,RuntimeException 和 Error 以及繼承它們的例外和錯誤都是 unchecked exception 才對。

選項 E,除了 RuntimeException 和繼承 RuntimeException 的例外之外,Exception 和其它繼承 Exception 的例外都是 checked exception。