标识符命名规范

 1 /*
 2 标识符命名规范
 3     硬性规定:
 4         1、标识符必须以字母,下划线或者美元符号开头
 5         2、其他部分必须是字母,数字,下划线或者美元符号,但是不能出现特殊符号
 6         3、标识符大小写敏感
 7         4、不能是java的关键字或者保留字(留给系统使用的表示特殊含义的字符串)
 8     常规建议:
 9         1、驼峰标识
10             1、类名,接口名称在命名的时候要首字符大写
11             2、方法,变量命名的时候首字符要小写
12             3、多个单词拼接表示一个标识符的时候,每个单词的首字符都大写
13         2、见名知义
14             通过标识符的名称能知道代表的含义
15             千万不要写拼音
16 */
17 public class IdentifiedDemo{
18     public static void main(String[] args){
19         int _a = 10;
20         int $b=20;
21         //int a+b=30
22         int a = 10;
23         int public = 20;
24         int getValueById = 12;
25     }
26 }

 

posted @ 2020-10-13 18:29  zhou_yi  阅读(162)  评论(0)    收藏  举报