Java Custom Exception Classes

Advertisements

  Top Tutorials     New Tutorials     Submit     Login     Register  

Tutorial Detail

Java Custom Exception Classes

Quite frequently, we read in Java books that we can inherit from Exception/RuntimeExcetion classes or implement the Throwable interface in order to cr
http://extreme-java.blogspot.com/2011/03/java-custom-exception-classes.html
  • Total Hits: 12004

  • Average Rating :
    URL RatingURL RatingURL RatingURL RatingURL Rating

  •  

  • Total Votes: 141 votes

  • Category: JAVA/Core JAVA

  • Submitted on: 2011-03-08 21:39:05

  • Submitted By: Sandeep Bhandari

  • Set as Favorite

Description:

Quite frequently, we read in Java books that we can inherit from Exception/RuntimeExcetion classes or implement the Throwable interface in order to create application specific exception classes.

There are scenarios where the exception hierarchy present in the Java JDK is not sufficient to capture the essence of the erroneous condition in an application. These custom exceptions can be thrown using the throw keyword whenever the corresponding condition occurs.


The exception handler catch blocks can be present in the same method or can be present in the caller code.
But most of the applications don't not have custom exceptions unless a lot of thinking has been done over the design of the application. This is probably because of the time constraints in a project or the lack of knowledge.    More detail...

Rating Detail

 Stars  Percentage  Total Vote
 One star  Vote LeftVote MiddleVote Right 38.3%  54
 Two starsTwo star  Vote LeftVote MiddleVote Right 9.93%  14
 Three starsThree starsThree stars  Vote LeftVote MiddleVote Right 12.77%  18
 Four starsFour starsFour starsFour stars  Vote LeftVote MiddleVote Right 10.64%  15
 Five starsFive starsFive starsFive starsFive stars  Vote LeftVote MiddleVote Right 28.37%  40

Caste Your Vote

 Rating  Selection  Guidelines
 Poor:     Very disappointing, useless.
 Fair:     Below average, disappointing but not useless.
 Good:     About average in its class.
 Very Good:     Above average for its category.
 Excellent:     One of the best Tutorials in its category.





Advertisements
Advertisements