Java Reference
In-Depth Information
Just as there are two kinds of set implementations, the Java library has two
implementations for maps: HashMap and TreeMap . Both of them implement the
Map interface (see Figure 4 ).
The HashMap and TreeMap classes both implement the Map interface.
After constructing a HashMap or TreeMap , you should store the reference to the
map object in a Map reference:
Map<String, Color> favoriteColors = new
HashMap<String, Color> ();
Figure 3
A Map
705
Search WWH ::




Custom Search