map put值 使用匿名函数

时间:2023-03-09 08:33:57
map put值 使用匿名函数
       List<Map<String, Object>> list = setRoleMenuRlMapper.selectMapByParams(params);
// Map map = new HashMap<String, Object>();
// map.put("hahaha","111");
// map.put("xixi", "22222222");
// list.add(map); list.add(new HashMap<String, Object>() {
{
put("haha","1111");
put("xixi", "22222222");}
});

代码块会 执行

相关文章