Tuesday 22 January 2019

Groovy: List can take object of any type


In Groovy, list can take objects of different type.

HelloWorld.groovy
myDetails = ["Krishna", 29, 5.8, "Bangalore"]

println myDetails

Output
[Krishna, 29, 5.8, Bangalore]


Previous                                                 Next                                                 Home

No comments:

Post a Comment