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

how to create multithreaded program? : Java thread

723


What is protected access modifier?

806


What are thread priorities and importance of thread priorities in java?

840


Is double bigger than float?

764


Can we declare the main method of our class as private?

778


Can we change the value of static variable?

721


Differences between external iteration and internal iteration?

877


Does java have a compiler?

801


what is bmg file and how to create that files?what will it contailn?

2153


Which programming language is most secure?

757


Can we create constructor in abstract class ?

813


What are the different types of inner classes?

787


What is an example of declaration?

771


What is lazy initialization in java?

764


What is the latest java version?

815