Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Checked and Unchecked Exception

 
nitin sethi
Ranch Hand
Posts: 59
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could anyone confirm if the below is the exact classification for checked and unchecked exception?


1. Throwable (checked)
1.1 Error (unchecked)
1.1.1 unchecked hierarchy
1.2 Exception (checked)
1.2.1 checked hierarchy
1.2.2 RuntimeException (unchecked)
1.2.2.1 unchecked hierarchy
 
naveen yadav
Ranch Hand
Posts: 384
Java MyEclipse IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes your classification is correct.
In other words

Unchecked Exception = (Error and its subclass Exception + Runtime and its subclass Exception ).

Checked Exception = (Throwable Exception - Unchecked Exception).






 
Javin Paul
Ranch Hand
Posts: 295
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In simple words, Any Exception which is sub-class or inherited from RuntimeException is unchecked Exception and doesn't require to be declared on throws clause. rest are checked exceptions.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic