Sunday, 27 January 2019

Groovy: Create empty map


Use [:] to create empty map.

HelloWorld.groovy
def map = [:]

println "Total elements in the map are : ${map.size()}"

Output
Total elements in the map are : 0

Previous                                                 Next                                                 Home

No comments:

Post a Comment