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 |
Why is the main method declared static?
what is the difference between the "protected and default" modifiers?
Is java still relevant?
What is static synchronization?
What is protected in java?
How many boolean functions are there?
What is n in java?
what is hashmap& hashtable with example?
What is meant by interface?
What are the classes of java?
can we override the main() method in java????
3 Answers Vimukti Technologies,
What are meta-annotations?