为什么输出会是这样?不知道该怎么改
public class Student {private int id;
private String name;
private int age;
void StudentInfo(int id,String name,int age){
this.id=id;
this.name=name;
this.age=age;
}
int getid(int id){
return id;
}
String getname(String name){
return name;
}
int getage(int age){
return age;
}
int altid(int id){
return id;
//修改id
}
String altname(String name){
//修改名字
return name;
}
int altage(int age){
//修改年龄
return age;
}
public String toString(String s){
return("id="+id+",name="+name+",age="+age);
}
public static void main(String args[]){
Student stu=new Student();
stu.getid(001);
stu.getname("张三");
stu.getage(20);
System.out.println(stu);
stu.altid(002);
stu.altname("李四");
stu.altage(21);
System.out.println(stu);
}
}