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

what do you understand by synchronization? Or what is synchronization and why is it important? Or describe synchronization in respect to multithreading? Or what is synchronization? : Java thread

706


What are functions in java?

713


Can a final method be overloaded?

723


Why does java not allow multiple public classes in a java file ?

3921


What are operators and its types?

815


Is java 11 paid version?

716


What are exception handling keywords in java?

809


Is logger a singleton?

718


What is unsigned char?

843


What is the byte range?

792


How to change the priority of thread or how to set the priority of thread?

830


What do you mean by static variable?

794


What is the difference between compare and compareto in java?

708


What is the collections api in java programming?

771


What is the difference between throw and throws keywords?

811