public class Student(
private String name=null;
private int age = 0;
public void setName(String name){
=name;
}
public String getName(){
return ;
}
public void setAge(int age){
e=age;
)
public int getAge(){
return e;
}
public Student(String name ,int age){
if(age <0){//确保年龄不小于0
e=0;
}else{
e=age;
}
if((name==null)||(name。
equals(""))){//确保名称不是空值
="NONAME";
}else{
=name;
}
}
public Student(String name ){
this(name,0);
}
public Student(int age){
this("NONAME",age);
}
public Student(){
this("NONAM