Thursday, October 27, 2011

Java - Traversing a map

System.out.println(lineSeparator + "Using traditional Iterator and key set");
for(Iterator it = data.keySet().iterator(); it.hasNext();) {
    Object key = it.next();
    Object value = data.get(key);
    System.out.println(key + " = " + value);
}

No comments:

Post a Comment

Blog Archive