Practice mode Java

Which of these is an unchecked exception in Java?

Correct answer D. NullPointerException

Explanation

Unchecked exceptions are RuntimeException, Error and their subclasses, and NullPointerException extends RuntimeException. The compiler does not force code to catch or declare them. IOException, SQLException and InterruptedException are checked, so a method must handle them or list them in its throws clause, and failing to do so is a compile-time error.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.