Question:
Explain the user defined Exceptions?
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. Source: CoolInterview.com
for eg: class userExcep extends Exception{userExcep(String msg){super(msg);}} Source: CoolInterview.com
Answered by: MAK | Date: 5/28/2010
| Contact MAK
User defines exception are Exception Subclasses. It allows you to create your own exception types to handle situations specific to your application....
In order to define user defined exceptions::::: define subclass of Exception class(which is a subclass of Throwable)
Source: CoolInterview.com
Answered by: Surbhi Sehgal | Date: 6/19/2010
| Contact Surbhi Sehgal
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|