ProgrammingModerateTCS NQT · Infosys pattern

Which of these is a checked exception in Java?

  1. A. IOException
  2. B. ArrayIndexOutOfBoundsException
  3. C. ArithmeticException
  4. D. NullPointerException

Correct answer: A. IOException

Checked exceptions extend Exception but not RuntimeException, and the compiler forces you to catch or declare them; IOException is one. The other three extend RuntimeException and are unchecked.

More OOP with C++ and Java questions

Exams that ask this topic