Standard Java violation

Source: Internet
Author: User
Tags throwable

Java contains a class called Throwable, which describes everything that can be "tossed" as an offence. There are two general types of Throwable objects (i.e., "Inherit from Throwable"). Where the error represents compile time and system errors, we generally do not have to deliberately capture them (except in exceptional cases). Exception is the basic type that can be "tossed" from a class method in any standard Java library. In addition, they can be "tossed" from our own methods and from the occasional events of the run period.

The best way to get a comprehensive idea of a violation is to read the online Java documentation provided by Http://java.sun.com (and, of course, download them better first). In order to have a general impression of the various offences, this work is quite valuable. But we will soon find that there is no special place between an offence and the next one, except for the name. In addition, the number of violations provided by Java is increasing; In essence, it is meaningless to print them in a book. Any new libraries that you get from other places may also provide their own violations. What we need most is the basic concepts and what we can do with these offences.

Java.lang.Exception

This is the basic violation that the program can capture. All other offences are derived from it. It is important to note that the name of the offending representative is a problem, and that the offending name is usually carefully selected and can clearly explain what happened. Violations are not entirely defined in Java.lang, and some are meant to provide support for other libraries, such as util,net and IO--we can see this from their full class names, or observe what they inherit from. For example, all IO violations are inherited from Java.io.IOException.

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.