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。