- Map<String,String> map = new HashMap<String,String>();
- map.put("1", "a");
- map.put("2", "b");
- map.put("3", "c");
- map.put("4", "d");
- map.put("5", "e");
- Set set=map.entrySet();
- Iterator it=set.iterator();
- while(it.hasNext()) {
- Map.Entry entry=(Map.Entry)it.next();
- if(entry.getValue().equals("a")) {
- System.out.println(entry.getKey());
- }
- if(entry.getValue().equals("b")){
- System.out.println(entry.getKey());
- }
- if(entry.getValue().equals("c")){
- System.out.println(entry.getKey());
- }
- }