public boolean equals(Object obj){
if(this==obj){
System.out.println("1");
return true;
}
if(!(obj instanceof Student1)){
return false;
}
Student1 stu=(Student1)obj;
if(stu.name.equals(this.name)&&stu.age==this.age){
return true;
}else{
System.out.println("A"+stu.name);
System.out.println("B"+this.name);
return false;
}
}
HUWWW
千万里不及你
相关分类