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

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

Sanjay Babu's photo
Sanjay Babu
·May 2, 2022·

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.

 
Share this