Twins
unknown
java
a year ago
478 B
2
Indexable
Never
public boolean equals(Person person) { // jei nuorodos i vienoda - adresa objektas tas pats System.out.println("cia"); if (this == person) { System.out.println("Same!"); return true; } if (!(person instanceof Person)) { return false; }; if (!this.birthday.equals(person.birthday)) { return false; } if(this.name != person.name && this.height != person.height && this.weight != person.weight) { return false; } return true; }