Here you can find the source of printMap(Map
public static void printMap(Map<String, Integer> map)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { public static void printMap(Map<String, Integer> map) { for (Map.Entry<String, Integer> entry : map.entrySet()) { System.out.println("[Key] : " + entry.getKey() + " [Value] : " + entry.getValue()); }// ww w. ja va 2s . c om } }