C#语言教程:类、对象和引用声明

访问修饰字class类名{变量声明,方法声明}

class Student {long id; //学号char gender; //性别int classID; //班级号,注意不能用class作属性名void ChangeClass(int aClassID) //更改班级{… } }

类名引用名

Student student;

new类构造函数

student = new Student();

引用名.变量名/方法名(参数)

student.id = 200328013203194;

ppt 文件大小:5.59MB