What is the difference between error and exception and
explain in simple words not whatever is given in the book.

Answer Posted / muffy.jad@gmail.com

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

Is This Answer Correct ?    26 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we make constructors static?

831


What ide should I use for java?

570


Does isempty check for null?

665


what is static import in java? Explain

668


Is intellij better than eclipse?

635






What is the main use of java?

670


Which is easier .net or java?

748


Is alive in java?

593


Explain reverse a linked list recursive java solution?

640


What is the meaning of nullable?

661


What is sorting in java?

627


What are abstract classes and anonymous classes?

725


Explain some best practices you would apply while using collection in java?

673


How do you define a variable?

620


Is empty set an element of empty set?

708