Map <String,String>map = new HashMap<String,String>(); map.put("aa", "aa"); map.put("bb", "bb"); for(Map.Entry<String, String> entry : map.entrySet()){ String mapKey = entry.getKey(); String mapValue = entry.getValue(); System.out.println(mapKey + ":" + mapValue); }