Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

Groovy supports the usual while {...} and do {...} while loops like Java.

for loop

The for loop in Groovy is much simpler and works with any kind of array, collection, Map etc.
Note: the standard for loop is not implemented by beta-10.
// for (int i = 0; i < 5; ++i) // not implemented by beta-10.


In addition, you can use closures in place of most for loops, using each() and eachWithIndex():

  • No labels