paramhello01bd8da7-84b0-4f52-9f98-fd15f4dbc1a7
代码如下:
//第一个闭包
def c1 = {
v ->
print v
}
//第二个闭包(不包含参数)
def c2 = {
print 'hello'
}
//有参数'param'的闭包,千万别导包
def method1(Closure closure){
closure('param')
}
//不带参数的闭包,千万别导包
def method2(Closure closure){
closure()
}
method1(c1)
method2(c2)
我的没遇到这个问题