One - One Code All

Blog Content

Java List<Map<String, String>>中添加数据

Java   2017-02-25 09:45:54

java  List 用法。

Map map = new HashMap();
map.put("key1", "value1");
map.put("key2", "value2");
List> list = new ArrayList>();
list.add(map);
for(int i = 0;i < list.size();i++)
{
    Map map = list.get(i);
    String authorStr = map.get("key1").toString();
    System.out.println("author" + " : " + authorStr);
}



上一篇:idea 推荐安装插件,自定义安装插件
下一篇:IntelliJ IDEA导入已有的别的项目module打开多个项目且相互调用代码

The minute you think of giving up, think of the reason why you held on so long.