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 |
How to sort an array in java without using sort method?
Define linked list and its features with signature?
What are "methods" and "fields"?
What is import java util arraylist?
Is string a wrapper class?
Similarity and difference between static block and static method ?
Which One is optimal to choose ? Syncronized hash map or Hash table with single thread model? How can a hash map syncronized with out using syncrozed blocks in programm?
What is an object-oriented paradigm?
How does indexof work?
Does a class inherit the constructor of its super class?if it does, how can you hide that constructor? if it doesnot how can you call it from the sub class?
What checkbox method allows you to tell if a checkbox is checked?
How do I convert a string to an int in java?