命名方法:
1、骆驼(Camel )命名法:首字母小写,后每个单词首字母大写。 例如,studentName
2、帕斯卡(Pascal )命名法:将每个单词的第一个字母大写。 例如,StudentName
3、匈牙利命名法:加前缀。 例如btnName、txtName。
1 .命名空间
采用Pascal命名法。
2 .班级
使用Pascal命名法确保类的名称是名词。 公共类健康世界{ . }
3、结构
Pascal命名法,以名词或短语为名称。
4、枚举
用Pascal命名法列举中的选择也是一样的。 PascalFileMod{Append, }
5 .命名成员变量。
公共成员变量、受保护的成员变量或内部成员变量必须使用Pascal命名法,专用成员变量必须使用Camel命名法,并以下划线开头。
6 .变量
内联变量(在方法中声明)必须用Camel命名法命名。 请勿使用单个字符作为变量名称,循环除外。
7 .常数
具有访问修饰符的常量是Camel命名法
具有公共访问修饰符、受保护修饰符的常量使用Pascal命名法。
8 .属性
pascalpublicclassstring { public int length { get; }
9、方法
使用pascalpublicclasshelloworld { void say hello,stringname}{.}
10,方法参数
使用Camel的命名法。
11,数组
使用Camel的命名法。
12、案件
pascalpublicclassprocess { publicevententhanderexited; }
13、异常系统
Pascal类名以Exception结尾,MyException
14、接口
Pascal接口名称使用ICloneable作为前缀