def map = [:];
map.a="1";
map.b="2";
println(map)
map.each{k,v->{
println("k:"+k);
println("v:"+v);
}};
def keySet = map.keySet();
def values = map.values()
println(keySet)
println(values)
结果
123
123
[a:1, b:2]
k:a,v:1
k:b,v:2
[a, b]
[1, 2]