Composite Literals - Groovin' with Groovy | [ Prev | Home | Next ] |
ages = [ 'Jim': 30, 'Bill': 24, 'Bob': 55 ] ages.each { name, age | println "${name} is ${age} years old." }
Example 9 (also note the use of a GString)
Copyright 2004 by Jim Weirich (Some Rights Reserved) |