导航

遍历listmap 遍历map

Posted on 2017-03-09 14:39  _eve  阅读(354)  评论(0编辑  收藏  举报
package excel;  
  
import java.util.ArrayList;  
import java.util.HashMap;  
import java.util.List;  
import java.util.Map;  
  
public class List1  
{  
  public static void main(String[] args)  
  {  
  
    Map map = new HashMap<String, Object>();  
    map.put("1", "fds");  
    map.put("2", "valu");  
    List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();  
    list.add(map);  
    for (Map<String, Object> m : list)  
    {  
      for (String k : m.keySet())  
      {  
        System.out.println(k + " : " + m.get(k));  
      }  
  
    }  
  
  }  
} 

map的for循环中for(Map.Entry<String, Object> entry : paraMap.entrySet())