Context:
主要是寄给自己看,不推荐其他人阅读
Map:
langs = ['key1': 'value1','key2': 'value2']
println langs.getClass().name //java.util.LinkedHashMap
println langs['key1'] //value1
println langs.key2 //value2,所以不能用 .属性,如.class来获取class属性了
each、collect、:
1.一个形参是Entry
langs.each{ entry ->
prinlnt "Language $entry.key was $entry.vlaue".}
2.两个形参是key、val、finde、findAll
langs.each{key,value ->
println "Lanauage $key was $value"}