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 to perform linear search in java?

759


Variables used in a switch statement can be used with which datatypes?

749


What is the difference between ArrayList and Vector? which one is better in Java

850


Are variables stored in ram?

778


What is bom encoding?

783


Define a java class.

1098


What is thread synchronization in java?

674


Is string pool garbage collected?

782


Given a singly linked list, find the middle of the list in a single traversal without using temporary variable.

838


What is continuity of a function?

789


What is a marker interface?

845


What is the maximum size of array in java?

755


What is difference between fileinputstream and filereader in java?

793


Should a main method be compulsorily declared in all java classes?

814


Can a top level class be private or protected?

800