Skip to content

Instantly share code, notes, and snippets.

  • Save shuji/1721496 to your computer and use it in GitHub Desktop.
Save shuji/1721496 to your computer and use it in GitHub Desktop.
Closure
class Foo {
def foo(String name) {
def _ = {
"Hello ${name}"
}
def __ = _.call()
return __
}
}
println new Foo().foo("World")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment