Java OCA OCP Practice Question 1773

Question

Which of the following classes is an unchecked exception?

  • A. java.io.IOException
  • B. java.io.NotSerializableException
  • C. java.sql.SQLException
  • D. java.util.MissingResourceException


D.

Note

Only one of the classes, MissingResourceException, inherits from the unchecked RuntimeException class, making Option D the correct answer.

IOException and SQLException extend the checked Exception class directly.

The NotSerializableException is also checked, since it is a subclass of IOException via ObjectStreamException.




PreviousNext

Related