- Constructs a new, empty set; the backing HashMap instance has the specified initial capacity and default load factor (0.75).
But the term "initial capacity" is never disclosed.
Some sources say it is the actual number of buckets, so then it is advisable to store not more than capacity * loadFactor
elements.
I think "initial capacity" argument is the number of elements I can store (optimally), so the physical number of buckets will be elements / loadFactor
, then rounded towards the power of two (away from zero).