Java OCA OCP Practice Question 362

Question

Which of the following are checked exceptions?

Choose all that apply

  • A. Exception
  • B. IllegalArgumentException
  • C. IOException
  • D. NullPointerException
  • E. NumberFormatException
  • F. StackOverflowError


A, C.

Note

Option A is the exception base class, which is a checked exception.

Options B, D, and E extend RuntimeException directly or indirectly and therefore are unchecked exceptions.

Option F is a throwable and not an exception, and so should not be caught or declared.




PreviousNext

Related