public class Student {
private int id;
private String name;
private int sex;
private int age;
public Student(int id, String name, int sex, int age) {
this.id = id;
this.name = name;
this.sex = sex;
this.age = age;
}
public void updateAge(int age) {
this.age = age;
}
public int getId() {
return this.id;
}
public String getName() {
return this.name;
}
public int getSex() {
return this.sex;
}
public int getAge() {
return this.age;
}
}
Student a = new Student(1001, "Jay", 0, 18);
a.updateAge(19);