Which of the following is a checked exception?



Which of the following is a checked exception?

A. ClassCastException

B. IOException

C. ArrayIndexOutOfBoundsException

D. IllegalArgumentException

Answer:

B. IOException

Explanation:

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, making Option B the correct answer.

Free Spring Boot Tutorial - 5 Hours Full Course


Watch this course on YouTube at Spring Boot Tutorial | Fee 5 Hours Full Course

Comments