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

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many ways can we create the string object?

774


Does list allow duplicates in java?

700


What are 3 data types?

750


What happens if I remove static from main method?

760


How can we find the actual size of an object on the heap?

1065


How do you find the independent variable?

741


What is a parameter in simple terms?

751


Explain a situation where finally block will not be executed?

768


What is parsing in grammar?

784


What is the difference between superclass and subclass?

787


What is the gregoriancalendar class in java programming?

784


How to find the largest value from the given array.

764


What is command line argument

935


What is ‘has a’’ relationship in java?

950


What is boolean used for?

791