These days in the Java game, are all about the basics of Java basic things, here to tidy up:
Java is a language that distinguishes the case of letters (case-sensitive) and the naming conventions for packages, classes, variables, and so on in the Java language.
(a) The name of package (packages):
The package name should be made up of a lowercase word, such as net.ebseries.modules.
(ii) Class (class) naming:
The first letter of class is capitalized, usually a class name is synthesized from multiple words, requiring the first letter of each word to be capitalized, for example: DataFile or Infoparser.
(c) The name of the variable:
The name of the variable can be mixed in case, but the first character should be lowercase. The words are separated by uppercase letters, and the limit is underlined and the dollar symbol ($) is restricted, because this character has a special meaning for the inner class. such as: Inputfilesize.
(iv) Naming of Interface (interface):
Similar to the name of class.
(v) Naming of Static Final variable (equivalent to constant)
The name of the Static Final variable should be capitalized and indicate the full meaning, for example: Final maxuploadfilesize=1024.
(vi) Naming of methods
The first word of the method name should be a verb, and the case can be mixed, but the first letter should be lowercase. Within each method name, uppercase letters separate the words and limit the use of underscores. The name of the parameter must be the same as the variable's naming convention. Use meaningful parameters to name them, and, if possible, use the same names as the fields to be assigned:
- Setcounter (int size) {
- this.size = size;
- }
Naming the array
The array should always be named in the following way: byte[] buffer; instead of: Byte buffer[] (habitual problem only).
It should be noted that the name should be used as much as possible in the full English descriptor (there are exceptions). In addition, lowercase letters should generally be used, but the class name, interface name, and the first letter of any non-initial word should be capitalized.
The following points are summed up as follows: Try to use the full English descriptors, the use of terminology applicable to related fields, the use of mixed case to make the name readable, as few abbreviations as possible, but if used, to use wisely, and throughout the project unified, avoid the use of long names (less than 15 letters is a good idea), Avoid using a similar name, or just a different name, avoid underlining (except for static constants, etc.).
JAVA Naming conventions