Difference between error and exception

Answer Posted / modi

An error is an irrecoverable condition occurring at runtime.
Such as OutOfMemory error. These JVM errors and you can not
repair them at runtime. While exceptions are conditions that
occur because of bad input etc. e.g. FileNotFoundException
will be thrown if the specified file does not exist. Or a
NullPointerException will take place if you try using a null
reference. In most of the cases it is possible to recover
from an exception (probably by giving user a feedback for
entering proper values etc.).

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is null a string in java?

752


Can java run on google chrome?

869


What do you mean by platform independence?

779


What is the loop in java?

792


Why isn’t there operator overloading?

800


How do you find the independent variable?

734


How long will it take to learn java?

725


What is the difference between hashmap and hashtable in java?

758


What is oop in java?

711


Is array synchronized in java?

780


Why java is object oriented?

774


How do singleton patterns work?

722


What if constructor is protected in java?

754


What are the four integer types supported by java?

776


What are the features in java?

791