Logical ! has higher
precedence over Logical &&
!true && false
=> false && false (Since ! has higher precedence over &&)
=> false
Logical &&
has higher precedence over Logical ||
true || true && false
=> true || false
=> true
HelloWorld.groovy
a = (!true && false) b = (true || true && false) println "a : ${a}" println "b : ${b}"
Output
a : false
b : true
No comments:
Post a Comment