Created
October 2, 2012 08:53
-
-
Save pks1976/3817499 to your computer and use it in GitHub Desktop.
list definition in Groovy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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