Java. Lang. excetion, java. Lang. runtimeexception, java. Lang. Error what is the difference?

Source: Internet
Author: User
The error class object is generated and thrown by the Java virtual machine, and the exception class object is generated and thrown by the application.ProgramProcess or throw
Error indicates that recovery is not a serious problem that is impossible but difficult. For example, memory overflow. It is impossible to expect the program to handle such a situation.
Error indicates system-level errors and exceptions that the program does not need to handle,
Runtimeexception is a subclass of exception. In general, this exception cannot be caught when the program throws this kind of error during runtime. If it is not processed in the program, when the program is running, it is generated and handed over to JVM for processing.
An exception indicates an abnormal state that may occur during the running of the program. An exception indicates an exception that may occur during common operations on the virtual machine. It is a common running error. The Java compiler requires that the method must declare that the possible non-runtime exception is the same, but it does not require that an uncaptured runtime exception be thrown.
Exception indicates a design or implementation problem. That is to say, it indicates that if the program runs normally, it will never happen.
Exception indicates the exceptions that need to be captured or processed by the program.

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.