hashcode() and equals() method [duplicate]
问题 This question already has answers here : What issues should be considered when overriding equals and hashCode in Java? (11 answers) Closed 6 years ago . so i have a question on hashcode() and equals() method Let's say I just write a very basic program overridng both the methodes import java.util.*; class Employee { private String name; private int empid; public Employee(String name,int empid) { this.name=name; this.empid=empid; } public int getEmpid() { return empid; } public String getName()