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
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