The internal HashSet uses a HashMap, a value hash key is generated and used to store the item in a HashTable.
To generate a hashcode element, the method HashCode()is called
Below the HashMap method, place the element that HashSet internally uses to add the element:
public V put(K paramK, V paramV)
{
if (paramK == null)
return putForNullKey(paramV);
int i = hash(paramK.hashCode());
-----------------------------^
}
source
share