In Java, exceptions are classified as checked exceptions, and run-time exceptions. Both are in the exception class hierarchy. This type of easy-to-choose quiz did you master the exception class and know which exception classes must be captured
The following figure shows the inheritance relationship of the Java exception class.
Figure 1
The pink is the checked exception (checked exceptions), which must be captured by the Try{}catch statement block or declared in the method signature through the throws clause. The checked exception must be caught at compile time, named checked Exception Because the Java compiler is checking, the Java Virtual machine also checks to ensure that the rule is adhered to.
The green exception is the runtime exception (runtime exceptions), which requires the programmer to analyze the code to determine whether to capture and process, such as a null pointer, 0 apart ...
When declared as error, it is a serious error and requires special handling based on business information, and error does not need to be captured.
For more information, please refer to: Top ten Questions about Java Exceptions
Related articles :
- Top Ten Questions about Java Exceptions
- Java Exception Handling Example
- Java IO class hierarchy diagram
- Operating System Concepts Hierarchy Diagram
Interview Preparation (c) Java Exception class hierarchy