Implements the Map, extends the HashMap.
Provides ordered entries (key-value pairs) in a HashMap. It is a double-linked list among entries similarly to LinkedList.
All methods from Map and HashMap are available.
LinkedHashMap provides slower performance than HashMap and needs more storage.
Constructor signatures:
(): default capacity is 16, default load factor is 0.75; the order will follow the order as the entries will be added
(capacity in int, load factor in float): like the a. version, plus: how many entries it can store, and if load factor is exceeded, the map is moved to an other map with double size
(capacity in int, load factor in float, accessOrder): like the b. version with accessOrder is false; if accessOrder is true, entries will be ordered by when the entries were accessed, last will be the most recently accessed entry
(other LinkedHashMap): creates (deep copies) a new map from an other LinkedHashMap; need identical pair types
Coming from the above versions, accessOrder is false by default and optional to use it.
EXAMPLE FOR CREATING A NEW LINKEDHASHMAP FROM AN OTHER:
EXAMPLE FOR SORTING A LINKEDHASHMAP: