10. HashTable
HashTable
HashSet and HashMap
@Override
public boolean equals (Object obj){
if (obj == null || !(obj instanceof ContactList)){
return false;
}
return new HashSet(names).equals(new HashSet(((ContactList)obj).names));
}
@Override
public int hashCode(){
return new HashSet(names).hashCode();
}Last updated