Java exceptions are features that we always use in programming, but we rarely pay attention to the details.
Exception architecture
All exceptions are derived to Throwable, and the main 2 inherited classes are exception and error.
We often say that the exception refers to exception,exception divided into check Exception and unchecked Exception.
An error is interpreted in the JDK documentation as a serious problem that indicates that a reasonable application should not attempt to catch, most of which are exception conditions. One of the more special is threaddeath, we should not go to catch this exception, familiar with multithreaded programming friends will definitely know why.
Check Exception and Unchecked Exception
Prior to learning C + + and C #, all exception handling belonged to unchecked Exception, and later learning Java found that the Java language, for some exceptions, forced the requirement to declare methods what exception was thrown, and when it was necessary to force some exceptions to be caught, This exception belongs to the check Exception.
About when should use check Exception, when should use unchecked Exception many people have discussions, and there is no unified conclusion. But the vast majority of the views are: mixed use.