Java tutorial
//package com.java2s; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Set; public class Main { public static ArrayList<String> getHashMap(HashMap<String, String> hm) { ArrayList<String> a = new ArrayList<String>(); Set<Map.Entry<String, String>> s = hm.entrySet(); Iterator<Map.Entry<String, String>> it = s.iterator(); while (it.hasNext()) { Map.Entry<String, String> m = (Map.Entry<String, String>) it.next(); a.add(m.getKey() + "\t" + m.getValue()); } return a; } }