Arithmeticexception (exception with a division of 0), bufferoverflowexception (buffer overflow exception), bufferunderflowexception (buffer overflow exception), indexoutofboundsexception (outbound exception ),Nullpointerexception(NULL pointer exception), Emptystackexception (empty stack exception), illegalargumentexception (invalid parameter exception), negativearraysizeexception, nosuchelementexception, securityexception, systemexception, undeclaredthrowableexception
1. java. Lang. nullpointerexception
The exception is interpreted as "the program encounters a null pointer". In short, it calls an uninitialized object or a non-existent object, that is, the array initialization and array element initialization are confused. Array initialization allocates the required space to the array. The elements in the initialized array are not instantiated and are still empty, therefore, you also need to initialize each element (if you want to call it)
2. The exception of Java. Lang. classnotfoundexception is interpreted as "the specified class does not exist ".
3. The exception of Java. Lang. arithmeticexception is interpreted as a "mathematical operation exception". For example, if a division by zero operation occurs in a program, this exception occurs.
4. java. Lang. arrayindexoutofboundsexception
The exception is interpreted as "array subscript out of bounds". Currently, most programs operate on arrays. Therefore, you must check the array carefully when calling the array, check whether the subscript you call is beyond the range of the array. In general, it is not easy to make such an error when calling (that is, directly using a constant as a subscript), but it is implicit (that is, using a variable to represent the subscript) an error occurs frequently when a call is made. In another case, the length of the array defined in the program is determined by some specific methods rather than stated in advance. At this time, check the length of the array to avoid this exception.
5. java. Lang. illegalargumentexception
This exception is interpreted as "method parameter error", such as G. setcolor (INT red, int green, int blue) three values in this method, if there is more than 255, this exception will also occur, so once this exception is found, what we need to do, check whether the parameter passing in the method call is incorrect.
6. java. Lang. illegalaccessexception
This exception is interpreted as "no access permission". This exception occurs when the application calls a class but the current method does not have access permission for this class. Pay attention to this exception when package is used in the program.