Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

exception  RSS feed

 
Ranch Hand
Posts: 156
Eclipse IDE Hibernate Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do You create Your own type of Exception
thanks
 
Ranch Hand
Posts: 1141
1
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Santoshkumar,
To create your own "Exception" type, just define a class that extends one of the existing exception classes.
[The parent of all exception classes is "java.lang.Throwable".]
Have you read the Creating Your Own Exception Classes section of the Java Tutorial?
Good Luck,
Avi.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!