摘要:
闭包是什么?看看Groovy Documentation里面的定义:Closures are similar to Java's inner classes, except they are a single method which is invokable, with arbitrary parameters.我自己的理解:闭包就是一个method变量,可以有很多的参数。简单的闭包实例:def closure = { param -> println("hello ${param}") }closure.call("world!")cl 阅读全文
posted @ 2012-05-26 18:08 eastson 阅读(499) 评论(0) 推荐(0) 编辑