Which of these four standard classes is a checked exception in Java?
- aNullPointerException, because dereferencing null is a common enough mistake that the compiler forces you to handle it
- bIOException, because it extends Exception directly rather than RuntimeException, so it is checked✓
- cArithmeticException, because dividing by zero is always detectable at compile time and therefore checked
- dIllegalStateException, because it signals a serious programming error that must always be declared or caught
Explanation:A checked exception is any subclass of Exception that does NOT extend RuntimeException. IOException extends Exception directly, so it is checked and must be declared with
throws or caught. NullPointerException, ArithmeticException and IllegalStateException all extend RuntimeException, so they are unchecked and the compiler never forces you to handle them.