
1 54
Chapter 9: Collections m
and print this value. Note that although in this case the map has been ordered by descending
key order, the Hasl~ap class does not guarantee ordering. If order has to be guaranteed, we
must use the SortedMap interface as described in Section 9.3.1.
Apart from keySet, the other set view methods are values, which returns a collection of
values contained in the map, and entrySet, which returns a collection of key value mappings
contained in the map. In the preceding MapExample, the entrySet view would be
5=Able 4=Brown 3=Smith 2=Jones l=Smith
Details of all the Map interface methods and their implementations ...