Groovy web console

subscribe to the feed Subscribe
to this

Resolve - variable examples

Published 3 weeks ago by Jocelyn Arcega
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
//simple variable, in that case a string
def randomvariable = "ksdfjkgjfhs"
println randomvariable

//list or array
def myList = []
myList[0] = "djhdsfjhf"
myList[1] = "aaaa"
println myList

//map or object
def myMap = [:] = "Henry"
myMap.age = "36"
println myMap

//list of maps or collection
def myCollection = []
myCollection[0] = myMap
myCollection[1] = myMap
println myCollection