Java.lang.ClassNotFoundException
This anomaly is a lot of developers originally developed in the development environment such as JB, put JB under the package under the WTK to compile frequently problems, the explanation of the exception is "The specified class does not exist", here the main test
Consider the name and path of the class is correct, if it is in the JB under the package, is usually the default plus packages, so go to the WTK to pay attention to the package path Add.
No.2 Java.lang.ArithmeticException
The explanation of this anomaly is "mathematical operation Anomaly", for example, the program appears divided by 0 such an operation will be such an exception, for this anomaly, we have to check the program involved in the number
Where the math is going, the formula is wrong.
No.3 Java.lang.ArrayIndexOutOfBoundsException
This exception is believed many friends also often encountered, the exception explanation is "array subscript out of bounds", now most of the program has an array of operations, so in the call arrays must be carefully checked, see
The subscript that you call is not the range of the array, in general, the display (that is, directly with the constant subscript) call is not easy to make such a mistake, but the implicit (that is, the variable is the subscript) call is often wrong
, there is also the case that the length of the array defined in the program is determined by certain methods, not in advance, and it is better to look at the length of the array before this exception occurs.
。
No.4 Java.lang.IllegalArgumentException
The explanation for this exception is "parameter error of the method", and many of the methods in the J2ME class library will cause such errors in some cases, such as the volume parameter in the volume adjustment method if written as a negative number will
This exception occurs, such as g.setcolor (int red,int green,int blue) Three values in this method, if there are more than 255 of this exception will also occur, so once found that the XOR
Often, all we have to do is hurry and check that the parameter passing in the method call is not an error. No.6 java.lang.IllegalAccessException
This exception is interpreted as "no access", which occurs when the application is calling a class, but the current method does not have access to the class. The application of the package
Attention to this anomaly.
No.5 Java.lang.IncompatibleClassChangeError
Not concurrently
The class change error of the tolerance. This exception is thrown when an incompatible change is made to the class definition on which the method being executed depends. It is common to modify the declaration definitions of some classes in the application without having to weigh the entire application
This error is easily thrown when the new compilation is run directly.
No.6 Java.lang.InstantiationError
Instantiation of the error. This exception is thrown when an application attempts to construct an abstract class or interface through Java's new operator.
No.7 Java.lang.LinkageError
Link error. The error and all its subclasses indicate that a class depends on another class, and after that class has been compiled, the dependent class has changed its class definition without recompiling all the classes, which in turn raises an error condition
。
No.8 Java.lang.StackOverflowError
Stack overflow error. This error is thrown when the hierarchy of an application recursive call is too deep to cause a stack overflow.
Common Java Exceptions