def map1 = [a: 1, b: 2, c: 3]
def printMap(Map map) {
for (e in map) {
print "${e.key}:${e.value} "
}
println()
}
printMap(map1)
printMap(q:1,w:2,e:3,s:4)
ctrl+shift+F10运行:
def map1 = [a: 1, b: 2, c: 3]
def printMap(Map map) {
for (e in map) {
print "${e.key}:${e.value} "
}
println()
}
printMap(map1)
printMap(q:1,w:2,e:3,s:4)
ctrl+shift+F10运行: