Referring to the link above, what big difference does a closure makes when we compare it with a normal function?
SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
posted 8 years ago
From the link above:
"Closures may be 'bound' to variables within the scope where they are defined"
In addition to that, you can pass a closure as an argument to a method. Then that method can call your closure. This means you can give a method some block of code, and the method can execute that block of code.
I'd recommend reading the Formal Definition on the Groovy site. [ April 10, 2008: Message edited by: Josh Brown ]