Why are package names and method names in java lowercase?

Java is a case-sensitive language. Here are some examples to illustrate the naming conventions of packages, classes, variables, etc. in the Java language.

(a) the name of the package (package):

The package name should consist of lowercase words, such as net.ebseries.modules.

(2) the naming of the class:

The first letter of a category is capitalized. Usually multiple words are combined into a class name, and the first letter of each word is capitalized, such as DataFile or InfoParser.

(3) Naming of variables:

Variable names can be mixed in case, but the first character should be lowercase. Words are separated by uppercase letters and underscores, and the dollar sign ($) is restricted because this character has special meaning to inner classes. Such as: inputFileSize.

(4) Naming of interfaces: similar to the naming of classes.

(5) Naming of static final variables (equivalent to constants)

The names of static Final variables should be all capitalized and express the complete meaning, for example, final maxuploadfilesize =1024.

(6) 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. In each method name, uppercase letters separate words and restrict the use of underscores. The name of the parameter must be consistent with the naming convention of the variable. Use meaningful parameter names and, if possible, the same names as the fields to be assigned:

set counter(int size){ this . size = size; }

Naming of arrays

Arrays should always be named in the following ways: byte [] buffer; No: byte buffer [] (habitual problem).

It is worth noting that when naming, you should try to use complete English descriptors (with some exceptions). In addition, lowercase letters should generally be used, but the first letters of class names, interface names and any non-initials words should be capitalized.

To sum up, it is as follows: try to use complete English descriptors, use terms suitable for related fields, use mixed case to make names readable, and use abbreviations as little as possible, but if you use them, use them wisely and use them uniformly throughout the project, and avoid using long names (less than 15 letters is a good idea), similar names, or just use different cases, and avoid using underscores (.