is the Throwable class in Java being checked for exceptions?

Source: Internet
Author: User
Tags throwable

is q:throable being checked for abnormalities?
A: Yes

In the Java specification, the definition of a non-checked exception and a checked exception is this:

    • The unchecked exception classes is the run-time exception classes and the error classes.
    • The checked exception classes is all exception classes other than the unchecked exceptionclasses. That is, the checked exception classes be throwable and all it subclasses other than RuntimeException and its subclasses and Error and its subclasses.

That is, run-time exception all exceptions except and its subclasses, and error its subclasses, are checked for exceptions.

The exceptions in Java are categorized as follows:

    • ErrorUsually some underlying hardware-related errors, unrelated to the program itself, should not be captured because of the inability to capture.
    • RuntimeExceptionIs the exception thrown by the program itself, such errors must be the programmer's own logic errors or irregularities caused, can be captured or not captured, if not actively captured will be processed by the JVM.
    • The rest 受查异常 is not expected in the programming process, such as file read and write exceptions, database access exceptions, and so on, this is not the program itself error, in order to ensure the robustness of the program, these exceptions must be captured.

is the Throwable class in Java being checked for exceptions?

Related Article

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.