Java’s Checked and Unchecked Exceptions- demystified

Until recently, I had hard time remembering what is the difference between checked and unchecked exceptions.

Finally Head First Java gave me the prompt explanation. Here it goes:

Checked Exceptions: Arise due to the reasons which are beyond control of programmer so complier mandates them to handle or declare.

Unchecked Exceptions: Arises due to logic flaws in the code.So these should be eliminated.Exception Handling mechanism is not supposed to take care of programmer injected logic flaws in the code.So complier wont bother.It is the responsibility of the programmer to eliminate them.

I am also looking for similar kind of prompt and clear explanation for the difference between Error and Exception.If you get to know, I appreciate if you can share with me.

Published by Chaitanya

I am a family man, perpetual learner, coffee drinker, dessert eater and Happiness Engineer at Automattic. I also read, write, move, and meditate.

Leave a comment

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: