Archive for October, 2012

Convert a HashMap to a List?

HashMap map = new HashMap();
map.put (1, “Java”);
map.put (2, “C++”);
List list = new ArrayList(map.values());
for (String s : list) {
System.out.println(s);
}

Advertisements

Leave a comment