Following are 3 useful constructors to help you. Use it wisely :). More info here
HashMap()
Constructs an empty HashMap with the default initial capacity (16) and the default load factor (0.75).
HashMap(int initialCapacity)
Constructs an empty HashMap with the specified initial capacity and the default load factor (0.75).
HashMap(int initialCapacity, float loadFactor)
Constructs an empty HashMap with the specified initial capacity and load factor.
As @Xoce mentioned, you can't change loadFactor later, I do agree with
him on this. Use it while creating the hashmap.
@NPE has provided great details here about significance of loadfactor.