What is the need of "creating and throwing an
UserdefinedException" when the "Exception" class is already
available?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How hashmap increases its size in java?

493


What is the mapping mechanism used by java to identify IDL language?

591


Why string is not a wrapper class?

646


Name four container classes.

559


What is unicode datatype?

531






How many bits is a 64 bit byte?

537


Can this keyword be used to refer static members?

547


Can you declare a private method as static?

699


How to convert string to byte array and vice versa?

586


What is the difference between scrollbar and scrollpane?

611


What is ‘has a’’ relationship in java?

726


Why we used break and continue statement in java?

561


What is gui programming?

522


What are the basics of core java?

550


You can create a string object as string str = “abc”; why cant a button object be created as button bt = “abc”;? Explain

534