Java beginner __ identifier specification

Identifier refers to the content defined by ourselves in the program, such as the name of the class, the name of the method, the name of the variable, etc., are all identifiers.

Such as: HelloWorld, then for beginners and even for all developers, to develop a good naming habit is the first step as a programmer, so as I will pay special attention to this here, and it will also allow me to type very The first step of the big project, so how can it be regarded as a naming convention and an excellent naming requirement. Below, I will tell you in brief:
naming rules (hard requirements):
1. 26 uppercase and lowercase letters can be used , 0-9 numbers. $ And _ these identifiers.
2. The identifier must not start with a number.
3. The identifier cannot be a keyword, such as class.
Naming specification (soft requirements):
1. Class name specification: capitalize the first letter, and then capitalize every word afterwards. (Big camel case)
2. The variable name specification: the first letter of the first word is lowercase, and every subsequent word is uppercase. (Little camel case)
3. Method name specification: the same as the variable name specification (small camel case).
Hard requirements cannot be violated. Once violations occur, errors will be reported in the program. Although soft requirements will not be reported, they can save you a lot of time in writing a large project and also allow you to work Efficiency becomes more convenient and faster.

Guess you like

Origin blog.csdn.net/weixin_48850992/article/details/108729793