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
272 views
asked Nov 25, 2015 by nanospeck (3,820 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 (3,820 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.

Do you have Mnemonics?

Submit your Mnemonics to Win Cash Prizes!


*Deadline: 15th March 2017
...