JAVA exception class, JAVA

Source: Internet
Author: User

JAVA exception class, JAVA

1. Exception (Exception): An exception that the program can handle.

2 . Error(Error): an error that cannot be processed by the program. These errors indicate that the fault occurs on the virtual machine itself, or occurs when the virtual machine attempts to execute an application, and generally does not need to be processed by a program.

3. Check exceptions (exceptions that must be handled by the compiler): Except for Error, RuntimeException, and its subclasses, all other Exception classes and their subclasses are traceable exceptions. This exception is characteristic of the Java compiler checking it. That is to say, when such exceptions may occur in the program, either catch it with a try-catch statement or throws it with a throws clause declaration, otherwise, compilation fails.

4. Non-check exceptions (exceptions that the compiler does not require to handle): including runtime exceptions (RuntimeException and its subclass) and errors ).

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.