Java examples for java.util:List Operation
print List of Map to console
//package com.java2s; import java.util.Iterator; import java.util.List; import java.util.Map; public class Main { public static void main(String[] argv) { List list = java.util.Arrays.asList("asdf", "java2s.com"); printMapList(list);//from w ww . ja va2 s . co m } public static void printMapList(List<Map> list) { Map map = null; for (int i = 0; i < list.size(); i++) { map = list.get(i); Iterator iter = map.entrySet().iterator(); while (iter.hasNext()) { Map.Entry entry = (Map.Entry) iter.next(); System.out .println(entry.getKey() + ": " + entry.getValue()); } } } }