Skip to content

Instantly share code, notes, and snippets.

@pks1976
Created October 2, 2012 08:53
Show Gist options
  • Select an option

  • Save pks1976/3817499 to your computer and use it in GitHub Desktop.

Select an option

Save pks1976/3817499 to your computer and use it in GitHub Desktop.
list definition in Groovy
def numbersList = [9, 2, 99, 22] // list with four items
println numbersList [0] // 9
println numbersList [3] // 22
println numbersList [-1] // 22 , If the integer index is negative, then it refers to elements by counting from the end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment