So far we have discussed Iterators, Collection Interfaces and Classes. In this tutorial we shall
discuss about Maps.
● A map is an object that stores key/value pairs.
● The keys must be unique but the values may be duplicated.
● Maps don’t implement the Iterable interface. Therefore, you can’t obtain an iterator to a
THE MAP INTERFACE
These interfaces define the character and nature of maps.
THE MAP ABSTRACT CLASS:
THE MAP CLASSES:
These classes provide concrete implementation of the Map which can used by programmers.
The below table shows various differences among the Map classes. All the terms used in the
table are same as the one used in Collection Classes table except one, which is -
1) Random Access - In Maps, Random access is “Yes” if get(key) returns the value associated
with that key.
The Time Complexities of basic operations are given below:
Java Collections Tutorial Series: