Java Core Reading notes the 11th chapter

Source: Internet
Author: User

1. Exceptions

The user wants the program to take some sensible action in the event of an error. If some operations cannot be completed due to an error, the program should: return to a security state and be able to make some other commands, or allow the results of all operations to be saved and terminate the program in an appropriate manner.

Exception handling tasks: Transfer control from where the error occurred to an error handler that can handle the situation.

Exception Categories: Throwable:error and exception

    • Error: Describes an internal error and resource exhaustion error for the Java Runtime system that is hungry. Applications should not run out of this type of object. If such an internal error occurs, in addition to the notification to the user, and try to make the program safe exit.
    • Exception:a. RuntimeException: An exception that is caused by a program error. (Runtime)

B. Other exception: There is no problem with the program itself, but exceptions due to problems such as I/O errors belong to other exceptions.

Java Core Reading notes the 11th chapter

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.