Monday, September 30, 2013

groovy # pass closure to method

In groovy one can pass functionality as one would pass variables to a method The output should look like this
## Params asdfasdf
#### No params
If you choose to pass a closure that requires paramaters then one would need o sourround the closure in curly brackets
doWith(4, {param "asdfasdf"})
Otherwise
doWith(5,noparam)

No comments:

Post a Comment