6.变量的命名规范

变量的命名规范

  • 所有变量、方法、类名都要求 见名知义。

  • 类成员变量:首字母小写 及 驼峰原则 :除了第一个单词以外,后面的单词首字母大写。如 monthSalary 、 lastName。

  • 局部变量: 首字母小写 及 驼峰原则。

  • 常量:大写字母和下划线:static final double KK = 9.2;static final float MAX_VALUE = 3000.1f;

  • 类名:首字母大写 和 驼峰原则:DataType 、 DataExtended。

  • 方法名:首字母小写 和 驼峰原则: run(),runRuntime()。

posted @ 2020-12-30 21:40  jyurokuya  阅读(125)  评论(0)    收藏  举报