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 |
What is backdrop?
How can we create objects if we make the constructor private ?
Can we make a constructor final?
Which is better ascii or unicode?
A non-static inner class may have object instances that are associated with instances of the class’s outer class. A static inner class does not have any object instances.
how to accept integer array in java
Map map = new HashMap(2); map.add(“1”,”one”); map.add(“2”,”two”); map.add(“3”,”three”); What will happen at this line?
suppose in a class there is a code like this: { Set hs=new Hashset(); hs.add(new Emp("kathy",1000)); hs.add(new Emp("kathy",2000)); } how can u avoid the above code in your class as set won't allow duplicate objects?
What is merge sort in java?
After compilation of java program we'll get .class code. If it's generated in OS Windows XP will it work on OS Linux? If yes why? If no why?
In real time project which driver did u use? What is the main functionality of the Prepared Statement?
What are anonymous inner classes?