What is the need of "creating and throwing an
UserdefinedException" when the "Exception" class is already
available?
Answers were Sorted based on User's Feedback
Answer / vinayakkatkar
There are some exceptions that are not defined by java api
ex- invalid age exception ,invalid number exception etc.
in user defined exceptions are raised by programmer,
thrown by programmer ,handled by programmer
while predefined exceptions are raised by system,
thrown by system
handled by programmer
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / guru
user defined exception is used throwing out(user) own
exception..
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / seshadri pera
UserDefindException are thrown and handled based on the
user requirements to make sure the particular exception
conditions intead of throwing the general exception for all
the exceptions.
We should handle the specific exception first by using
catching it instead of handling generic exceptions of type
Exception.
| Is This Answer Correct ? | 0 Yes | 1 No |
Do I need java on my pc?
How can you make a class serializable in java?
Differences between external iteration and internal iteration?
can write code for serialization ?
What is the final variable?
Is Cegonsoft Pvt.Ltd. a good Institute?
If an object is garbage collected, can it become reachable again?
What is the history of java?
What is the multi-catch block in java?
What do you mean by Remote procedure call?
Why is singleton instance static?
Are maps ordered java?