List<Map<String, Object>>用法以及方法

  • Post author:
  • Post category:其他




首先先看看map.put()这个方法

put方法是向里面插入内容

public static void main(String[] args)throws InterruptedException{
    Map map = new HashMap();
    map.put("age","年龄");
    map.put("sex","性别");
    map.put("date","注册日期");
    int size = map.size();
    System.out.println("Map集合的大小为:"+size);
}

List<Map<String,Object>>是list类型,里面的元素是map

@RequestMapping(value="/get_icons",method=RequestMethod.POST)
@ResponseBody
public Map<String,Object> getIconList(HttpServleetRequest request){
	Map<String,Object> ret= new HashMap<String,Object>();
	return ret;

}



版权声明:本文为awodwde原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。