public class Student {
private String name;
private int age;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public boolean inSameAge(Student s){
if(s.age==age){
return true;
}else{
return false;
}
}
}
public class student {
private String name;
private int age;
public student(){
name="无名氏";
age=20;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public boolean inSameAge(student s){
if (s.getAge() == this.age)
return true;
else
return false;
}
}