How I add dynamically a Map to List in Groovy

后端 未结 0 1902
[愿得一人]
[愿得一人] 2020-12-30 00:07

I want to dynamically add a map to a list like this:

def map = [:];
def list= [];

def n = 10;

n.times{
 map.put("Int I", it);
 list.add(map);
}
pr         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题