Java Exception class methods

Source: Internet
Author: User

E.getmessage (): Get exception information, print out the exception information, if the capture is not printed, but can call his method to print 9.4:

650) this.width=650; "src=" http://img.mp.itc.cn/upload/20161109/003cf3608d814eb59ebae0468b861728.jpg "style=" border:0px;margin:0px;padding:0px;font-size:0px; "/>

Figure 9.4

Gets the list of exceptions that are part of the list array element type. He is able to trace the wrong information, and can tell you the wrong number of rows, and what kind of problem, which file on the issue 9.41 Shows:

650) this.width=650; "src=" http://img.mp.itc.cn/upload/20161109/2cc07437cf974a71903ec3d025bddea3_th.jpg "style=" border:0px;margin:0px;padding:0px;font-size:0px; "/>

650) this.width=650; "src=" http://img.mp.itc.cn/upload/20161109/d11b0444558e485fb03ed53c3bc18898_th.jpg "style=" border:0px;margin:0px;padding:0px;font-size:0px; "/>

Figure 9.41

Printstacktrace (); Print the wrong list, He is generally used system.err printing, he has a special output error message where the print is Red. With the Err channel printed, so the print is shown in red 9.42:

Figure 9.42

Printstacktrace (), The wrong information can be presented, but also with the underscore 9.43:

Figure 9.42

He is relying on this method to present the error message, but he is missing a thread exception in thread "main" this Information. If you do not want him to print the red, you can pass out the out so that you can print the black Text.

Printstacktrace (); He is mainly to do the wrong tracking, can put the error one by one trace to find the source of the final error, 9.43 shows:

Figure 9.43

This error message is from the main method called the Method3 method, from the Method3 method called the Method2 method, from the Method2 method called the Method1 method, the problem is the topmost method, affecting all of the following METHODS. This is the list of Exceptions.

Technology Sharing: Www.kaige123.com

This article is from the "11247808" blog, please be sure to keep this source http://11257808.blog.51cto.com/11247808/1873860

Java Exception class methods

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.