java技术博客

jsp博客
数据加载中……
StudentOverloading.java
/*
*学生类的重载
*/
public class StudentOverloading{
public static void main(String[] args){
Student tom=new Student("Tom");
}}
/*
*学生类,包括学生的基本信息
*/
public static void main(String[] args){
S}
class Student{
private String strName="";
private String strNumber="";
private String strSex="";
private String strBirthday="";
private String strSpciality="";
private String strAddress="";
public Student(String name,Stirng number){
strName=name;
StrNumber=number;}
public String getStudentName(){
return strName;
}
public String getStudentNumber(){
return strNumber;
}
public String setStudentSex(String sex){
srtSex=sex;
}
public String getStudentSex(){
return strSex;
}
public String getStudentBirthday(){
return strBirthday;
}
public void setStudentBirthday(String birthday){
strBirthday=birthday;}
public String getStudentSpeciality(){
teturn strSpeciality;
}
public void setStudentSpeciality(String speciality){
strSpeciality=speciality;
}
public String getStudentAddress(){
return strAddress;
}
public void set}

posted on 2008-10-20 14:33 郭兴华 阅读(89) 评论(0)  编辑  收藏


只有注册用户登录后才能发表评论。


网站导航: