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 a static method in java?

764


What are some characteristics of interference class?

757


Is char a method in java?

748


Can we use string in the switch case?

799


What does microservices mean?

705


What is a container in a gui?

733


What are class members by default?

853


Can you create an object of an abstract class?

768


Which one of the following suits the description of a string better: derived or primitive?

732


Can memory leak in java?

792


Difference between ‘>>’ and ‘>>>’ operators in java?

874


What environment variables do I need to set on my machine in order to be able to run java programs?

792


What is the use of pattern in java?

774


What is the difference between Java1.4 and Java1.5

2058


Should database connections be singleton?

764