Method 1 : stay for Loop traversal value
Map<String, String> map = new HashMap(); map.put(" development ", " development "); map.put(" test ",
" test "); for (Object value : map.values()) { System.out.println(" First :" + value); }
Method II :: adopt key ergodic
for (String key: map.keySet()) { System.out.println(" Second :" + map.get(key)); }
Method III :: adopt entrySet Implementation traversal
Set<Map.Entry<String, String>> entrySet = map.entrySet(); for (Map.Entry
entry : entrySet) { System.out.println(" Third :" + entry.getKey() + " :" +
entry.getValue()); }
Method 4 :: adopt Iterator Iterator implementation traversal
Iterator<Map.Entry<String, String>> entryIterator =
map.entrySet().iterator(); while (entryIterator.hasNext()) { Map.Entry<String,
String> entry = entryIterator.next(); System.out.println(" Fourth :" +
entry.getKey() + " :" + entry.getValue()); }
Method 5 : adopt lambda Expression to traverse
map.forEach((key, value) -> { System.out.println(" Fifth :" + key + " :" +
value); });

Technology