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

What is the default size of set in java?

498


What are the restriction imposed on a static method or a static block of code?

591


What are decalarations?

636


How can you read content from file in java?

597


How does singleton class work?

524






What is thread start?

518


What happens if we override only equals?

580


Differentiate between a class and an object.

560


What are the changes in java.io in java 8 ?

549


Is an array a vector?

550


Is string is a data type?

568


Give differences between Quicksort &Mergesort. When should these sorts be used andwhat is their running time in java?

676


What is null mean in java?

623


What is the use of isempty in java?

535


What is difference between word and integer?

590