Iterate the keys from of a map in Java
Description
The following code shows how to iterate the keys from of a map.
Example
// w ww.j a v a2s .c om
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
public class Main {
public static void main(String[] argv) throws Exception {
Map map = new HashMap();
for (Iterator it = map.keySet().iterator(); it.hasNext();) {
Object key = it.next();
}
}
}