How to update value with specific key in Groovy

1 Answer

0 votes
def map = [name: "Groovy", age: 13, country: "United States", city: "New York"]

map.put("city", "LA")

println(map)
 

   
   
/*
run:
   
[name:Groovy, age:13, country:United States, city:LA]
   
*/

 



answered Oct 5, 2020 by avibootz

Related questions

1 answer 286 views
1 answer 257 views
1 answer 250 views
1 answer 163 views
2 answers 468 views
1 answer 216 views
1 answer 200 views
...