Will it be o.k. to return the unique key on the object as it's hashCode. For example, SSN for Person class and VIN for Vehicle class. As purpose of hashCode is to evenly distribute objects in collection, this will put one object in each bucket... Thanks Barkat
posted 13 years ago
hashCode has to return an int. Returning a unique int for each unique object is generally best.