Versions Compared

Key

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

...

Code Block
def (a, b, c) = [10, 20, 'foo']
assert a == 10 && b == 20 && c == 'foo'

You can provide types as part of the declaration if you wish, e.g.:

Code Block

def (int i, String j) = [10, 'foo']

As well as used when declaring variables (as above) it also applies to existing variables, e.g.:

...