HashMap (java.util.HashMap)

HashMap stores key/value combinations. On a JVM, this data structure is called a map. When inserting objects to a map, both the key object and value object are specified. With the key object, the value can be retrieved. This version of the structure does not keep the original order of the keys.

Technically, HashMap works by hashing the key object and storing it in such a way that the key can be quickly searched. Then a value is stored that is associated with the key. We will take a more detailed look at the working of this class after looking at some common methods and example code.