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



What is the need of "creating and throwing an UserdefinedException" when the "Except..

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

What is the need of "creating and throwing an UserdefinedException" when the "Except..

Answer / sri

if you want you could specify your own exception that you
know is gonna happen otherwise it is recommended to handle
the exception through exception class in catch block.

Is This Answer Correct ?    1 Yes 0 No

What is the need of "creating and throwing an UserdefinedException" when the "Except..

Answer / guru

user defined exception is used throwing out(user) own
exception..

Is This Answer Correct ?    0 Yes 0 No

What is the need of "creating and throwing an UserdefinedException" when the "Except..

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

Post New Answer

More Core Java Interview Questions

How to sort an array in java without using sort method?

0 Answers  


Define linked list and its features with signature?

0 Answers  


What are "methods" and "fields"?

0 Answers   Wipro,


What is import java util arraylist?

0 Answers  


Is string a wrapper class?

0 Answers  


Similarity and difference between static block and static method ?

0 Answers  


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?

3 Answers   Four soft,


What is an object-oriented paradigm?

5 Answers  


How does indexof work?

0 Answers  


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?

2 Answers  


What checkbox method allows you to tell if a checkbox is checked?

0 Answers  


How do I convert a string to an int in java?

0 Answers  


Categories