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 421 views
1 answer 375 views
1 answer 358 views
1 answer 264 views
2 answers 627 views
1 answer 334 views
1 answer 321 views
...