Which of these is a CHECKED exception?
Options
NullPointerExceptionIllegalArgumentExceptionIOException(Correct option)ArrayIndexOutOfBoundsException
Answer
IOException
Why
Checked exceptions extend Exception (but not RuntimeException). The compiler FORCES you to either catch them or declare them with throws. IOException (files, network) is the classic one.
Unchecked exceptions extend RuntimeException (NullPointerException, IllegalArgumentException, IndexOutOfBounds...). They usually mean a bug in the code, and the compiler does not force you to handle them.
Error (like OutOfMemoryError) is for serious JVM problems; you normally do not catch it.
Remember
Checked = compiler forces you to handle. Unchecked = RuntimeException.