Java tutorial
//package com.java2s; import java.util.*; public class Main { public static String printMap(Map in) { StringBuilder sb = new StringBuilder(); for (Iterator it = in.keySet().iterator(); it.hasNext();) { String key = (String) it.next(); sb.append(key).append(" : ").append(in.get(key)); sb.append("\n"); } return sb.toString(); } }