JavaTCoding

What's wrong with this equals/hashCode combinationšŸ¤”šŸ¤”?

class Person {
String name;

public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof Person)) return false;
return this.name.equals(((Person) o).name);
}
}

2 months ago | [YT] | 0