import java.util.*; /** * A simpple example of using java.util.HashMap. */ class TestHash { static public HashMap hm = new HashMap(1); public void test() { hm.put("abc", new Integer(5)); hm.put("xyz", new Integer(-99)); Collection all = hm.values(); Iterator allIterator = all.iterator(); while (allIterator.hasNext()){ System.out.println(allIterator.next()); } } }