All methods of Map is available.
Specific method are below.
Constructor signatures:
(): default capacity is 16, default load factor is 0.75
(capacity in int, load factor in float): how many entries it can store, if load factor is exceeded, the map is moved to an other map with double size
(other Map class): converting from that map to HashMap; need identical pair types
EXAMPLE FOR CONVERSION:
EXAMPLE FOR USAGE OF HASHMAP:
EXAMPLE FOR ITERATION:
Differences between HashMap and WeakHashMap:
HashMap keys are strong reference type, WeakHashMap keys are weak reference type
by the GC, released (not used) keys will be left in HashMap while will be freed in WeakHashMap
Differences between ConcurrentHashMap and HashMap:
ConcurrentHashMap is thread-safe, HashMap is not
ConcurrentHashMap provides methods for bulk operations like forEach(), search() and reduce(), HashMap does not
EXAMPLE FOR CONVERTING TO ARRAYLIST AND BACK: