Java examples for java.util:Map Value
print Map for each of its key value pair
//package com.java2s; import java.util.Iterator; import java.util.Map; public class Main { public static String printMap(Map map) { StringBuffer buf = new StringBuffer(); Iterator itKey = map.keySet().iterator(); while (itKey.hasNext()) { String key = (String) itKey.next(); buf.append(key + "=" + map.get(key) + ","); }// www . j a va 2 s .c om return buf.toString(); } }