Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
def printAll(container) {
    for (item in container) { println item }
}

def listnumbers = [1,2,3,4]
def hashmonths = [aMar:131, bApr:230, c:3, d:4May:31]
def colors = [java.awt.Color.BLACK, java.awt.Color.WHITE]
printAll listnumbers
printAll hashmonths
printAll colors

Results in the output:

Code Block
1
2
3
4
dMay=431
bMar=231
cApr=330
a=1
java.awt.Color[r=0,g=0,b=0]
java.awt.Color[r=255,g=255,b=255]

...