What is the difference between checked exception and unchecked exception. | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 1

What is the difference between checked exception and unchecked exception.

an example program might help me understand this better.

10th Aug 2017, 2:37 PM
Devbrath
Devbrath - avatar
1 Réponse
+ 2
checked exceptions must be handled in your code. unchecked exceptions (also called runtime exceptions) can be thrown by your program without having the compiler complaining. NullPointerException is runtime exception, it can be thrown inexpectedly. IOException, SQLException are checked exceptions so your program needs to handle those (catch or at least declare in method signature)
10th Aug 2017, 8:40 PM
Roland Sterkendries
Roland Sterkendries - avatar