- The java.util.HashMap class implements the Map interface using a hash code into an array.
HashMap <Integer, String> familyMap = new HashMap <Integer, String> ();
String name = "John";
familyMap.put(new Integer(3),name);
familyMap.put(new Integer(2),"Nancy");
familyMap.put(new Integer(1),"George");
Set <Integer> familyList = new TreeSet <Integer>();
familyList = familyMap.keySet();