Back to Top

Wednesday 18 January 2012

JAVA: Checked and UnChecked Exception

In Java, there are lots of sub-classes under java.lang.Exception class. we can divide these sub-classes into 2 types on the basis of compile-time checking.
The types are - Checked Exception  & Unchecked Exception.

Checked Exception: 
  • Except RuntimeException( java.lang.RuntimeException) class, all sub-classes of Exception are checked exception.
  • These exceptions need to include in a method's throws list, because these are checked by the compiler during compile time if a method handles or throws these exception. 


Unckecked Exception:
  • RuntimeException and its sub-classes are called as unchecked exception.
  • We don't need to include in a method's throws list, because these are not checked by the compiler during compile time.

1 Responses to “ JAVA: Checked and UnChecked Exception ”

suman said...
29 August 2018 at 18:25

I found best article.thank you for sharing useful info.
visit
web programming tutorial
welookups


Post a Comment

Popular Posts

Subscribe via Email
Subscribe Java Interview Questions via Email
All Rights Reserved JAVA INTERVIEW QUESTIONS | Privacy Policy | Anijit Sarkar