Naming rules for packages, classes, methods, properties, constants in Java
1: Package: Used to classify classes that do different functions, put them under different directories (packages), and package naming conventions: reverse the company domain name as the package name. For example, www.baidu.com for package name: each letter needs lowercase. For example: Com.baidu.test; The full name of the test class under the package is: Com.baidu.Test.java.
If the package is not used when defining a class, then Java will assume that the class we define is in the default packages. 2: Class: Capitalized, if a class is composed of multiple words, the first letter of each word is capitalized, and no connector is used in the middle. Use English as much as possible. such as ConnectionFactory 3: Method: The first word is all lowercase, if a method is composed of multiple words, start with the first letter from the second word, do not use a connector. Addperson 4: Properties: Same as method. such as Ageofperson 5: constant: All words are uppercase letters, if there are more than one word, then use the underline link. For example: public static final int age_of_person = 20; Usually plus static
Java Naming conventions