Common exceptions in Java project development

Source: Internet
Author: User
I believe that when we do the project, the console box often appear a variety of anomalies, a long time, you will find common also a few, below I summarize the common anomalies for your reference.


1 Java.lang.UnsupportedClassVersionError
Literally we can see that the class version does not support the error, in other words, the JDK version is incompatible, because we compiled the class on the high version, run in the lower version of the JVM, this is the answer I searched. It's okay to understand. But I found that my myeclipse is a high version of the JDK, the introduction of the project is a low version, it should be supported, but the same error occurred, so it is not easy to understand that the low version does not support the high version of the problem, the high version may not be compatible with the lower version, so it is best to set the same JDK , including project references and the JDK referenced by Tomcat.


2 java.lang.NullPointerException
This is a null pointer exception, which means that the object you are calling is NULL or the value is empty, the object is empty, and it is possible that you are referencing the object's method when there is no new object.


3 arrayindexoutofboundsexception
Array subscript out-of-bounds exception that is thrown when an index value that accesses a sequence is less than 0 or greater than or equal to the sequence size.


4 FileNotFoundException
The file did not find an exception that was thrown when an attempt was made to refer to a file under a path without a file under that path.


5 NumberFormatException
A numeric format exception that is thrown when an attempt is made to convert a string to a specified numeric type that does not satisfy the format required by the number type.


6 SQLException
Database operation exception, generally because the SQL statement is not correct, so that we write SQL statements is the best way to run the database command first.




Time is limited, next time add!

Common exceptions in Java project development

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.