Loop through Map in Groovy?

后端 未结 4 414
余生分开走
余生分开走 2021-01-30 02:11

I have a very simple task I am trying to do in Groovy but cannot seem to get it to work. I am just trying to loop through a map object in groovy and print out the key and value

4条回答
  •  天涯浪人
    2021-01-30 02:44

    When using the for loop, the value of s is a Map.Entry element, meaning that you can get the key from s.key and the value from s.value

提交回复
热议问题