重写equals模板
@Override
public boolean equals(Object obj) {
if(obj==null)
return false;
if(obj==this)
return true;
if(obj instanceof User){
User use=(User)obj;
return use.name.equals(this.name);
}
return false;
}
@Override
public boolean equals(Object obj) {
if(obj==null)
return false;
if(obj==this)
return true;
if(obj instanceof User){
User use=(User)obj;
return use.name.equals(this.name);
}
return false;
}