what is difference between Exception and Error?

Answer Posted / doshi rinal 9998099633

Error: Any departure from the expected behavior of the
system or program, which stops the working of the system is
an error. Exception:Any error or problem which one can
handle and continue to work normally.
An Exception can be caught and recovered:
ArrayIndexOutOfBoundsException means you tried to access a
position of an Array that does not exist - no big deal.
An Error is unrecoverable: OutOfMemoryError means that
the JVM has no more memory to store.
Java a compile time error is normally called an "error,"
while a runtime erroException can be handled and Error can
not be handled
When Error occur then our program stops and don't run but
If exception occur then nothing happening only try block
will be suspended and after that if any code is written
that will be executed properly means our system or program
work properly.
r is called an "exception."

Is This Answer Correct ?    13 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between char array and string?

528


What is communist flag?

573


What's the base class of all exception classes?

566


Class c implements interface I containing method m1 and m2 declarations. Class c has provided implementation for method m2. Can I create an object of class c?

1023


Explain about data types?

576






What is %02d?

577


What is difference between path and classpath?

564


Name few "optional" classes introduced with java 8 ?

651


What is array length?

507


Is hashset ordered?

551


What does it mean to be immutable?

552


How use .contains in java?

624


What is object data type?

569


what is a green thread? : Java thread

576


What is string [] args?

561