日期:2014-05-20 浏览次数:20823 次
struct student{
string Sno;
string Sname;
string Sgen;
string Sdept;
int Sage;
student(){
Sno = "";
Sname = "";
Sgen = "男";
Sdept = "";
Sage = 0;
}
};
student student_all[1000];
class stu{
private int grade = 0;
private String name ;
private String subject;
public stu(){}
public stu(String name, String subject, int grade){
this.name = name;
this.subject = subject;
this.grade = grade;
}
public void setName(String name) { this.name = name; }
public void setSubject(String subject) { this.subject = subject; }
public void setGrade(int grade) { this.grade = grade; }
public String getName() { return name; }
public String getSubject() { return subject; }
public int getGrade() { return grade; }
}
stu[] stu_all = new stu(10);
stu[] stu_all = new stu[3];