老师让我们写的较简单的一个程序,但有问题,求大神解答
//写一个关于家庭成员类,我用JCreator写的class Human{
String name;
int age;
char identity; //家庭身份
public Human(String name,int age,char identity){
this.name=name;
this.age=age;
this.identity=identity;
}
public String getName(){
return name;
}
public int getAge(){
return age;
}
public char getIdentity(){
return identity;
}
public void setName(String name){
this.name=name;
}
public void setAge(int age){
this.age=age;
}
public void setIdentity(char identity){
this.identity=identity;
}
}
class Family extends Human{
public Family(String name1,int age1,char identity1){
name=name1;
age=age1;
identity=identity1;
}
}