what is difference between Exception and Error?

Answer Posted / kannan

Error is a broader term which could be used to define all
not-so-expected behaviour of the program in
which 'Exception' is of one kind. Like many answered here,
exception is an unexpected behaviour at run time which
could cause the processor to rise the exception and can be
captured/handled in the program and further it could be
thrown to higher level code.

Compiletime error:
The other types of errors could be compile time errors
mainly captured by the compiler based on not-in-agreement
with the specific language specification.

Program logic error (function):
This type of error is left in the program after cleaning
compile time error and may or may not cause an exception.
This means the program could produce a wrond result.

Abnormal Operation error:
This type of error is produced by operating the program in
not so expected way. This means, under normal operating
condition the program will produce right results but could
produce wrong results if the operating procedure is not
followed. This is important aspect to fix in mission
critical applications.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When should we create our own custom exception classes?

595


Explain the Propertie sof class?

598


What is difference between java and java ee?

565


What is a function easy definition?

535


If goto and const is reserve words than why it is not work in java?

1513






What are user defined exceptions?

597


What is java util hashmap?

528


Why stringbuilder is not thread safe in java?

582


What is a java string?

549


Explain the concept of hashtables?

625


What is defined as false sharing in the context of multithreading?

516


What is the integer of 16?

543


How do you escape a string?

512


What is abstract class? Explain

605


What is a jagged array in java?

542