Common Java Exceptions

Source: Internet
Author: User
Tags throw exception

1. RuntimeException Sub-category:

1, Java.lang. arrayindexoutofboundsexception
Array index out-of-bounds exception. Thrown when the index value of an array is negative or greater than or equal to the size of the arrays.
2, Java.lang. ArithmeticException
Arithmetic condition exception. For example: integers except 0.
3, Java.lang. NullPointerException
Null pointer exception. This exception is thrown when an app tries to use null where the object is required. Example: Invoking an instance method of a null object, accessing the properties of a null object, calculating the length of a null object, throwing null with a throw statement, and so on
4, Java.lang. classnotfoundexception
The class exception could not be found. This exception is thrown when an application attempts to construct a class based on a class name in string form, and when a class file of the corresponding name is not found after traversing Classpah.

5, Java.lang. negativearraysizeexception Array length is a negative exception

6, Java.lang. Arraystoreexception An exception that is thrown in an array that contains incompatible values

7, Java.lang. SecurityException Security exception

8, Java.lang. illegalargumentexception Illegal parameter exception

2. IOException

  IOException: An exception that may occur when manipulating input and output streams.

  eofexception file has ended exception

  filenotfoundexception File not found exception

3. Other

classcastexception Type Conversion Exception class

Arraystoreexception An exception that is thrown in an array that contains incompatible values

SQLException manipulating Database exception classes

nosuchfieldexception field not found exception

The nosuchmethodexception method did not find the thrown exception

numberformatexception string conversion to a number thrown exception

stringindexoutofboundsexception String index out of range throw exception

illegalaccessexception does not allow access to a class of exceptions

instantiationexception When an application attempts to create an instance of a class using the Newinstance () method in the class classes, and the specified class object cannot be instantiated, the exception is thrown

Common Java Exceptions

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.