EXPLAIN THE USER DEFINED EXCEPTIONS?

Amit Singh

Total Post:565

Points:2825
Posted by  Amit Singh
Java 
 1251  View(s)
Ratings:
Rate this:
  1. Amit Singh

    Post:565

    Points:2825
    Explain the user defined Exceptions?

    User defined Exceptions are the separate Exception classes defined by the user for specific purposed. An user defined can created by simply sub-classing it to the Exception class. This allows custom exceptions to be generated (using throw) and caught in the same way as normal exceptions.
    Example:
    class myCustomException extends Exception {
         // The class simply has to exist to be an exception
    }

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!