public boolean equals(Object o){
if(o instanceof Person){
Person p = (Person) o;
return Objects.equals(this.firstName,p.firstName)
&&Objects.equals(this.lastName ,p.lastName)
&& this.age==p.age;
}
return false;
Sign in to make a reply
花开四季
public boolean equals(Object o){
if(o instanceof Person){
Person p = (Person) o;
return Objects.equals(this.firstName,p.firstName)
&&Objects.equals(this.lastName ,p.lastName)
&& this.age==p.age;
}
return false;
}