posted 15 years ago
Hi folks,
On pg 543 there is an exam watch that says:
'When using HashSet or LinkedHashSet, the objects you add to them must override hashCode(). If they don't override hashCode(), the default Object.hashCode() method will allow multiple objects that you might consider "meaningfully equal" to be added to your "no duplicates allowed" set.'
Shouldn't this be referring to equals() instead of hashCode() since it is the equals() method which is used by the set to determine if an incoming object is a duplicate or not?