Welcome to Questionaries, where you can ask questions and receive answers from other members of the community.

Let us know at info@questionaries.org

Explain the user defined Exceptions in java?

5 like 0 dislike
Hello
Explain the user defined Exceptions in java?
please reply me. i am waiting for your reply.
Thanx
asked 1 year ago by eagles11 (179,830 points)

1 Answer

1 like 0 dislike
 
Best answer
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
}
answered 1 year ago by DBA-boss (120,990 points)

Related questions

7 like 0 dislike
1 answer
7 like 0 dislike
1 answer
7 like 0 dislike
1 answer
5 like 0 dislike
1 answer
asked 1 year ago by daneim (127,080 points)
7 like 0 dislike
1 answer
asked 1 year ago by eagles11 (179,830 points)