How do I get contains to recognize two objects w/ same data as equal?
I created an EmployeeId class that has an int field called myId. What methods and interfaces should I implement in EmployeeId so the output of the program below will be "Already Have That EmployeeId!" ? I have tried to implement the Comparable interface and the equals and hashCode methods but no luck. Thanks for the help!
Justin
EmployeeId emp1 =new EmployeeId(100);
EmployeeId emp2 =new EmployeeId(100);
Vector<EmployeeId> vec =new Vector<EmployeeId>();
vec.add(emp1);
if(vec.contains(emp2)){
System.out.println("Already Have That EmployeeId!");
}else{
System.out.println("Does Not Contain That EmployeeId!");
}

