Interview Preparation (c) Java Exception class hierarchy

Source: Internet
Author: User

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 :

    1. Top Ten Questions about Java Exceptions
    2. Java Exception Handling Example
    3. Java IO class hierarchy diagram
    4. Operating System Concepts Hierarchy Diagram

Interview Preparation (c) Java Exception class hierarchy

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.