Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HashMap< String, String> map = new HashMap< String, String>();
- map.put(“Key1”, "Value1");
- map.put(“Key2”, " Value2");
- map.put(“Key3”, " Value3");
- Set set = hmap.entrySet();
- Iterator iterator = set.iterator();
- // Iterate over HashMap
- while(iterator.hasNext()) {
- Map.Entry mEntry = (Map.Entry)iterator.next();
- String key = mEntry.getKey();
- String value = mEntry.getValue();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement