4.
Guess the output.
(Can run and check code here – https://groovy-playground.appspot.com/)
def num = 'A'
switch(num){
case 0:
println "num is zero"
break
case {num>0}:
println "num is positive"
break
case {num<0}:
println "num is negative"
break
default:
println "invalid input"
}