Comparing Closures in Java, Groovy and Scala
Comparing Closures in Java, Groovy and Scala
Let’s start with the Java example that was given, remembering that this is a proposed syntax, that may or may not make it to Java 7 or later. As I understood the example it was this: imagine you want to add the ability to time a block of code, and you wanted to do it in a way that would look almost like a new keyword has been added to the language; and you wanted to pass in a parameter to name what you were timing; and the block you’re timing returns a result, or might throw an exception. So, quite an involved case.
Read More:
http://java.dzone.com/articles/comparing-closures-java-groovy
Thanks