常量—终态静态字段和临时终态本地变量—全部适用大写字母,并以下划线分隔各词,如MAX_CONNECTIONS。
Constants - final static fields and occasionally final local variables - are written in all uppercase with underscores separating the words, as in MAX_CONNECTIONS.
如果您知道,每一个全部由大写字母组成的名称都是常量,则会以不同的方式进行处理。
When you know that every name in all caps is a constant, you treat it differently.
类名和模块中的常量的第一个字母应该大写,而方法名和变量应该开始用小写字母。
Class names and constants in module scope should be capitalized, while method names and variables should start with a lower case letter.
常量应该使用驼峰格式(首字母大写)命名并且增加相关类的前缀。
Constants should be camel-case with all words capitalized and prefixed by the related class name for clarity.
如果缩略词是类型或常量名称的首个单词,只大写缩略词的第一个字母。
If an abbreviation appears as the first word in a type or constant, only capitalize the first letter of the abbreviation.
如果缩略词是类型或常量名称的首个单词,只大写缩略词的第一个字母。
If an abbreviation appears as the first word in a type or constant, only capitalize the first letter of the abbreviation.
应用推荐