When does Exception occurs?

Answer Posted / shakir khan

Exception is a condition that occur because of bad input
etc.
For example

FileNotFoundException will takesplace if the specified file
does not exist.

NullPointerException will be thrown if you try using a null
reference.

In most of the cases it is possible to recover from an
exception.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between add() and addelement() in vector?

1310


Why does java have different data types for integers and floating-point values?

780


What do you mean by an object in java?

886


Explain the differences between abstraction and encapsulation?

806


Can we serialize arraylist in java?

782


How do you sort in java?

791


What is a functional interface?

772


Explain different states of a thread in java?

819


What is main method?

786


Are variables stored in ram?

778


What is jpa specification?

748


Where is singleton pattern used?

757


What is variable and example?

737


What is the gregoriancalendar class in java programming?

796


Why is it important to initialize a variable?

754