Java OCA OCP Practice Question 1753

Question

Which of the following classes is a checked exception?

  • A. java.lang.Error
  • B. java.lang.IllegalStateException
  • C. java.text.ParseException
  • D. java.lang.RuntimeException


C.

Note

First off, Error is an unchecked exception.

It is recommended that Error not be caught by most application processes, making Option A incorrect.

IllegalStateException inherits RuntimeException, both of which are unchecked, making Options B and D, respectively, incorrect.

Option C is correct because ParseException must be handled or declared.




PreviousNext

Related