DigitMagazine

Maps Methods in Groovy

Jun 24th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1.  
  2. //Add another value
  3. map.put("Country", "India")
  4. println("Map => " + map.toMapString())
  5. //Check whether a map contains key or value
  6. println("Map Contains Key Country => " + map.containsKey("Country"))
  7. println("Map Contains Country Value India => " + map.containsValue("India"))
  8. //Map's size
  9. println("Map's Size => " + map.size())
Add Comment
Please, Sign In to add comment