Groovy web console

subscribe to the feed Subscribe
to this
site

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 = [:]
myMap.name = "Henry"
myMap.age = "36"
println myMap

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