DEV Community

Cover image for Day 2 - Differences between checked & unchecked exceptions in java!
C K Sanjay Babu
C K Sanjay Babu

Posted on • Originally published at blog.sanjaybabu.dev on

Day 2 - Differences between checked & unchecked exceptions in java!

Checked Exceptions

These are checked during compile time itself. Checked Exceptions should be either handled or the same should be notified with the throws keyword.

Example - SQLException, IOException.

Unchecked Exceptions

These exceptions are checked during runtime. The classes that inherit the RuntimeException fall under unchecked exceptions. It's not necessary to handle these exceptions.

Example - NullPointerException, ArrayIndexOutOfBoundsException.

Top comments (0)