1. When using the println () method for objects of type string, if the object is null, it will print null instead of raising the NullPointerException, which is an easy illusion, and can cause problems for subsequent operations on the string.
2. The main reason for the nullpointerexception exception is that there is no validation of the object's existence, often appearing in JSP programming: if (Request.getparameter ("username"). Equals ("xxx")), Out.println (Session.getattribute ("Record")) and so on. The solution to this problem is to perform a null comparison before use: if (Request.getparameter ("username")!=null) {IfIf (Request.getparameter ("username"). Equals (" xxx ")) ...}.
3. Throwing a NumberFormatException exception: The main reason is that the user entered other illegal characters when the user submitted content was converted to an integer or floating-point number. The main way to handle this is to catch this exception using the Try/catch block where the conversion is required and then prompt the user to enter the legitimate data.
4. Throwing Stringindexoutofboundsexception Exceptions: The main reason is to use a string of substring (), charAt () and other methods, and the length of the string is not enough, this exception is thrown; NullPointerException can also be thrown when the string is null. The solution is to NULL, judge the length, or convert to a byte array. Given the large number of operations, they can be encapsulated into JavaBean.
5. Cause Noclassdeffounderror error, the main reason is the class path or class file placement error, the placement of class files to meet the requirements of the server.
6. The main reason for the java.lang.Error error is that the external resources accessed by the system are not closed, resulting in a large amount of waste of external resources, which may eventually result in the system not functioning properly, and too many external resources being accessed by the system, and the external system cannot handle it properly; The external resources accessed by the system are abnormal. The solution is to: before accessing external resources, first, check that the resource (such as the database) is properly connected or manipulated, and if a connection is made to an external resource, a shutdown operation is made, and only one shutdown is performed, and the external resources are shared as much as possible in the same operation to reduce the consumption of resources by the operation. Improve the efficiency of program execution.