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

Collections, Lists, etc.

Why don't return statements work when iterating through an object?

The {...} in an each statement is not a normal Java block of code, but a closure. Closures are like classes/methods, so returning from one simply exits out of the closure, not the enclosing method.

How do I declare and initialize a list at the same time?

Syntax:

How do I declare and initialize a traditional array at the same time?

Syntax:

or

or

Labels
  • None