Groovy Functions


def numbers 0..9
println numbers.class
for (num in numbers{
if (isEven(num){
  println num
}
}

def isEven(num{
num%== 0
}


Output of Script

 81 ms
class groovy.lang.IntRange
0
2
4
6
8

Comments

Popular posts from this blog

தட்டு வண்டியில் காளிக்கோயில் - சிறுகதை

பிரேமாவின் பெண் குழந்தை

தீபம் பிளக்ஸ்