default value in closure groovy code example
Example 1: groovy3 closure
{ item++ } (1)
{ -> item++ } (2)
{ println it } (3)
{ it -> println it } (4)
{ name -> println name } (5)
{ String x, int y -> (6)
println "hey ${x} the value is ${y}"
}
{ reader -> (7)
def line = reader.readLine()
line.trim()
}
Example 2: groovy3 closure
{ [closureParameters -> ] statements }