groovy学习历程(第四章:闭包)
闭包闭包是一段匿名函数,由lambda表达式派生。传统方式求解: package groovy//求1到某个特定的数N之间所有偶数的和def sum(n) { total = 0 for (int i = 2; i <= n; i += 2) { total += i } total}println("sum of even ...