Which of the following Throwable types is it recommended not to catch in a Java application?

Which of the following Throwable types is it recommended not to catch in a Java application?

A. Error

B. CheckedException

C. Exception

D. RuntimeException

Answer:

A. Error

Explanation:

While Exception and RuntimeException are commonly caught in Java applications, it is recommended Error not be caught. 

An Error often indicates a failure of the JVM which cannot be recovered from. For this reason, Option A is correct, and Options C and D are incorrect. 

Option B is not a class defined in the Java API; therefore, it is also incorrect.


Comments