Java tutorial
//package com.java2s; import java.util.Iterator; import java.util.Map; import java.util.Set; public class Main { public static <V, T> void showMap(Map<V, T> map) { Set<Map.Entry<V, T>> set = map.entrySet(); for (Iterator<Map.Entry<V, T>> it = set.iterator(); it.hasNext();) { Map.Entry<V, T> entry = it.next(); System.out.println(entry.getKey() + "----->" + entry.getValue()); } } }