list的数据是通过map放进去的啊

解决方案 »

  1.   


    楼主结贴了。
    List<HashMap<Integer, String>> list = new ArrayList<HashMap<Integer, String>>();
    HashMap<Integer, String> m1 = new HashMap<Integer, String>();
    HashMap<Integer, String> m2 = new HashMap<Integer, String>();
    m1.put(1, "-->m1:one");
    m1.put(2, "-->m1:two");
    m2.put(3, "-->m2:three");
    m2.put(4, "-->m2:four");
    list.add(m1);
    list.add(m2); for (int i = 0; i < list.size(); i++) {
    HashMap<Integer, String> m = new HashMap<Integer, String>();
    m = list.get(i);
    Set<Entry<Integer, String>> set = m.entrySet();
    Iterator<Entry<Integer, String>> it = set.iterator();
    while (it.hasNext()) {
    Entry<Integer, String> e = it.next();
    System.out.println(e.getKey() + e.getValue());
    }
    }
    遍历出来了,自己琢磨吧