0

When a hash map is initialised, 16 slots are created. All the them are empty in the beginning. Load factor is the ratio of number of elements occupied to the size of the hash map. So the default or initial load factor must be 0 right? But while referring the java book by deitel and deitel it says the default load factor is 0.75. How is that possible?

Java Enthusiast
  • 1,161
  • 2
  • 15
  • 30

1 Answers1

1

From the javadoc

The load factor is a measure of how full the hash table is allowed to get before its capacity is automatically increased.

It's a threshold.

Sotirios Delimanolis
  • 274,122
  • 60
  • 696
  • 724