Groovy Closure

(1..10).findAll(it%2==}).each(println "In a closure: $it" })

Output of Script

 112 ms
In a closure: 2
In a closure: 4
In a closure: 6
In a closure: 8
In a closure: 10
 [2, 4, 6, 8, 10] java.util.ArrayList

Comments

Popular posts from this blog

தட்டு வண்டியில் காளிக்கோயில் - சிறுகதை

பிரேமாவின் பெண் குழந்தை

தீபம் பிளக்ஸ்