Error:
Error means something which is not correct. Errors can be handled. These errors cannot be handled at runtime. If an error occurs, the program will terminate. Errors usually stand for serious problems that the programmer (or the application) should not try to catch.
Exception:
Exception is an event which can disturb the normal program flow. Exception object is created by the method in which the exception occurred. Exception object contains useful information such as the type and the description of the exception.
Differences:
Basis | Error | Exception |
---|---|---|
Definition (www.oxforddictionaries.com) |
A mistake. | A person or thing that is excluded from a general statement or does not follow a rule. |
Synonyms | Flaw, misunderstanding, falsehood, offense, wrongdoing | Rejection, barring, reservation, exclusion and omission |
Antonyms | Achievement, success, accuracy, obedience and success | Inclusion, admittance, acceptance, allowance and admittal |
Pronunciation |
|
|
Types | Error is generally divided into two types:
|
Exception is generally divided into two categories:
|
Indicates | It indicates serious problems that a reasonable application should not try to catch. | It indicates conditions that a reasonable application might want to catch. |
Word origin | The word error was originated in the 13th century from the Middle English errour. | The word exception was originated in the 14th century. |
Nature | They are often fatal in nature and recovery. | They are not fatal in all the cases. |
Recovery | They cannot be recovered once occurred. | They are generally those problems from which a program can recover. |
Handled or not handled | Error is not meant to be caught. | Exception is meant to be caught. |
Caused by | These indicate a system error or a problem with a low-level resource. | These are caused by a programmer. |
Co-relation | Errors are also unchecked exception. | Exceptions are also Run-Time errors. |
Handled | Errors cannot be handled during a run time. | Exceptions can be handled during a run time. |
Example in Sentence |
|
|