Java OCA OCP Practice Question 1347

Question

Which of the following is a checked exception?

  • A. ClassCastException
  • B. IOException
  • C. ArrayIndexOutOfBoundsException
  • D. IllegalArgumentException


B.

Note

ClassCastException, ArrayIndexOutOfBoundsException, and IllegalArgumentException are unchecked exceptions and can be thrown at any time.

IOException is a checked exception that must be handled or declared when used.

Option B is the correct answer.




PreviousNext

Related