An essay on exception classes in Java

Source: Internet
Author: User

One: Inheritance relationship of Exception class

is a subclass of Throwable:
1.Exception (Exception): An exception that the program itself can handle.

2.Error (Error): An error that the program cannot handle. These errors indicate that the failure occurred on the virtual machine itself, or when the virtual machine attempted to execute the application, and generally did not require program processing .

3. Check for exceptions (exceptions that the compiler requires to be disposed of ): In addition to Error,runtimeexception and its subclasses, other exception classes and their subclasses are considered exceptions. This exception is characterized by the Java compiler checking it, that is, when such an exception can occur in a program, either by capturing it with a try-catch statement or by declaring it with a throws clause, or the compilation will not pass.

4. Non-check exception (compiler does not require disposition of exceptions): Includes run-time exceptions (RuntimeException with its subclasses) and errors (error).

An essay on exception classes in Java

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.