OCA Java SE 8 Exception - OCA Mock Question Exception 13








Question

Which of the following are unchecked exceptions? (Choose all that apply)

  1. ArrayIndexOutOfBoundsException
  2. IllegalArgumentException
  3. IOException
  4. NumberFormatException
  5. Any exception that extends RuntimeException
  6. Any exception that extends Exception




Answer



A, B, D, E.

Note

ArrayIndexOutOfBoundsException, IllegalArgumentException, and NumberFormatException are runtime exceptions.

Any class that extends RuntimeException is a runtime unchecked exception.

Classes that extend Exception are checked exceptions.