1. Objects that need to use end close () for database operations, IO operations, and so on must be closed in try-catch-finally finally (), and if there are multiple IO objects that require closing (), the method is try-catch to prevent an Io object from shutting down and other IO objects are not closed.
2. If the exception is not processed, the log should be logged after the abnormal capture of the system is not running normally.
3. The exception you throw must be filled in with detailed descriptive information.
4. Run-time exceptions are represented by RuntimeException subclasses, without the addition of throws clauses on method declarations that might throw exceptions. Non-run-time exceptions are inherited from exception and must be added throws clauses on the method declaration.
5. Use exception handling in the program or use error return code processing, depending on whether the program structure to determine, and the exception and error code should not be mixed, recommended use of exceptions.
6. Note the precedence of the operator and use the parentheses to clear the order of the expressions to avoid using the default precedence.
7. Avoid using numbers that are difficult to understand and replace them with meaningful logos. Constants involving physical states or physical meanings should not be used directly, and must be replaced with meaningful static variables or enumerations. Use exceptions to represent method execution errors instead of using C + + ERROR-return code.
8. Use int[] Index when declaring the array, instead of using int index[];
9. Do not use System.out and System.err for console printing, you should use the tool class (such as: Log tool) for uniform recording or printing.
10. Use the debugging switch to switch the debug and official versions of the software, rather than having both the official version and the debug version of the different source files to reduce the difficulty of maintenance.
11. The collection must specify the template type map<string,string> maps = new hashmap<string,string> ();
12. A file does not define two classes (not internal classes).
13. All data classes must overwrite ToString (), Hashcode (), Equals () methods, and the ToString () method returns meaningful content for that class.
14. Judge the statement not to use "* = = true" to judge the true
15. Do not write unnecessary upward forced transformation. int m = 10; float n = (float) m;