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 427 views
1 answer 381 views
1 answer 360 views
1 answer 270 views
2 answers 628 views
1 answer 335 views
1 answer 324 views
...