Good News Students! Become a Spellogram Contributor and Earn Money.Click Here To Know More!

What is the difference between Checked and Unchecked Exceptions in Java? Trick to remember.

0 votes
276 views
asked Nov 25, 2015 by nanospeck (4,590 points)
What is an easy way to remember the difference between checked and unchecked exceptions?

1 Answer

0 votes
answered Nov 25, 2015 by nanospeck (4,590 points)

In java Exception is an abnormal condition in code.
Checked exception in Java is something that is done during compile time.
Unchecked exception is an exception that extends RuntimeException and it occurs only while the program is running.

It's a bit confusing to remember both, but there is a simple trick to do this. 

The trick is to observe for the pattern 'UN'.

'UN'CHECKED exception extends R'UN'timeException

If you keep this pattern in mind you'll never get confused with checked and unchecked exceptions again.

Get ₹100 per Contribution

Submit your Mnemonics to Earn Money Instantly!


*Deadline: 15th August 2017
...