Description: (1) An exception is an unusual condition or error that occurs when a Java program runs (not compiled).
(2) Error indicates that the application itself is unable to overcome and restore a serious problem, the program is only a dead copy, for example, say memory overflow and thread deadlock and other system problems.
(3) Exception indicates that the program can also overcome and restore problems. Divided into common anomalies and system anomalies.
Common exception: also known as checked anomaly, is problems caused by changes or anomalies in the operating environment are issues that users can overcome. such as network drop line, hard disk space, and so on.
System exception: also known as unchecked exception, is the subclass of RuntimeException, is the software itself defects caused by the problem. which is the result of poorly thought out by software developers,
problem, software users cannot overcome and recover from this problem. but under this kind of problem can also let the software system continue to run or the person lets the software die.
such as: array out of bounds exception, null pointer exception, class conversion exception, etc.
(4) To solve the exception scheme:
1. Subject to compiler detection (checked), The compiler enforces a normal exception that must try: The catch or the throws declaration continues to be thrown to the upper calling method for processing.
2. the system exception can be handled or not handled by the virtual machine takeover, so the compiler does not enforce with try. catch processing or declaration with throws.
Java exception handling mechanism-simple comprehension