java定义学生类
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
定义学生类JA V A程序设计
class student
{
protected String studentNumber=null;
protected String name=null;
protected String sex;
protected int age=1;
protected String nation=null;
protected String sg=null;
protected String phoneNumber;
protected String email;
protected String speciality;
protected String score;
protected String tz;
protected String adress;
protected String birthday;
protected String classRoom;
public void setStudentNumber(String studentNumber)
{
this.studentNumber=studentNumber;
}
public String getStudentNumber()
{
return studentNumber;
}
public void set(String name)//修改姓名
{
=name;
}
public String getName() //获得姓名
{
return name;
}
public void setSex(String sex)
{
this.sex=sex;
}
public String getSex()
{
return sex;
}
public void set(int age)
{
this.age=age;
}
public int getAge()
{
return age;
}
public void setNation(String nation) //设置民族{
this.nation=nation;
}
public String getNation() //获取民族{
return nation;
}
public void setSg(String sg)
{
this.sg=sg;
}
public String getSg()
{
return sg;
}
public void setPhoneNumber(String phoneNumber)
{
this.phoneNumber=phoneNumber;
}
public String getPhoneNumber()
{
return phoneNumber;
}
public void setEmail(String email)
{
this.email=email;
}
public String getEmail()
{
return email;
}
public void setSpeciality(String speciality)
{
this.speciality=speciality;
}
public String getSpeciality()
{
return speciality;
}
public void setScore(String score) //设置分数{
this.score=score;
}
public String getScore() //获得分数{
return score;
}
public void setTz(String tz)
{
this.tz=tz;
}
public String getTz()
{
return tz;
}
public void setAdress(String adress)
{
this.adress=adress;
}
public String getAdress()
{
return adress;
}
public void setBirthday(String birthday)
{
this.birthday=birthday;
}
public String getBirthday()
{
return birthday;
}
public void setClassRoom(String classRoom)
{
this.classRoom=classRoom;
}
public String getClassRoom()
{
return classRoom;
}
}
class MyDate extends student