Java Exceptions Overview (simplified version)

Source: Internet
Author: User
Tags array length

1:arithmeticexception

Description: This problem occurs when there are operating conditions that do not conform to the rule, such as when the divisor is 0.

2:arrayindexoutofboundsexception

Description: This exception was thrown when using an illegal index, such as a negative index

3:indexoutofboundsexception

Description: Index (corner label) is out of bounds, for example, array length is 1 o'clock, get index 2

4:arraystoreexception

Description: An array store exception, that is, the type of the array and the type of data stored does not match.

5:classcastexception

Description: Class conversion exceptions, such as forcibly converting a class to a subclass other than an instance

6:illegalargumentexception

Description: A case where the parameter is not valid or the parameter is incorrect.

7:negativearraysizeexception

Description: An attempt was made to create an illegal array with an invalid array length, such as a negative length.

8:nullpointerexception

Description: A null pointer exception, such as a program requires a property of an object, but this object is null to throw this exception.

9:numberformatexception

Description: A case in which the program attempted to convert a string to a numeric value.

10:stringindexoutofboundsexception

Description: The index (corner label) is out of bounds and refers to a string.

11:classnotfoundexception

Description: The corresponding class could not be found, and if it was included in spring, the required class would throw this exception without annotations.

12:nosuchmethodexception

Description: This method does not exist, such as the new method in the MAVEN project and not compiled. This type of problem is thrown.

Java Exceptions Overview (simplified version)

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.