Naming conventions
The purpose of defining this specification is to make all documents in the project appear to be written by one person, to increase readability, and to reduce the loss caused by substitutions in the project team. (These specifications are not necessarily strictly adhered to, but make sure that the program has good readability)
The name of the Package
Package's name should all be made up of a lowercase word.
Name of Class
Class must have a name that starts with a capital letter and other words are lowercase
Name of Class variable
The name of the variable must begin with a lowercase letter. The following words begin with a capital letter.
Name of Static Final variable
The Static Final variable's name should all be capitalized, and the full meaning is indicated.
Name of the parameter
The name of the parameter must be the same as the variable's naming convention.
Name of array
The array should always be named in the following way:
byte[] buffer;
Instead of:
BYTE buffer[];
Parameter of the method
Use the name of a meaningful parameter, if possible, with the same names as the field you want to assign a value to:
SetCounter(int size){
this.size = size;
}
Java file Style
All Java (*.java) files must conform to the following style rules
Copyright information
Copyright information must begin at the beginning of the Java file, such as:
/**
* Copyright ® 2000 Shanghai XXX Co. Ltd.
* All right reserved.
*/
Other information that does not need to appear in Javadoc can also be included here.
Package/imports
Package The standard package names in import are preceded by the local package name before the import line, and are sorted alphabetically. If the import row contains a different subdirectory in the same package, it should be treated with *.
Package hotlava.net.stats;
import java.io.*;
import java.util.Observable;
import hotlava.util.Application;
Here java.io.* are used to replace InputStream and OutputStream.