Operator: !
Meaning: not
|
|
Suppose that P represents a Boolean expression.
The expression !P has the opposite truth value.
Code example: ! Kim.isWater(LEFT)
|
|
Operator: &&
Meaning: and
|
|
Suppose that P and Q
represent Boolean expressions.
The expression P && Q is only true when
both P and Q are true.
Code example: Kim.hasFlower() && Kim.isNet(AHEAD)
|
|
Operator: ||
Meaning: or
|
|
Suppose that P and Q
represent Boolean expressions.
The expression P || Q is only false when
both P and Q are false.
Code example: Pat.isJeroo(LEFT) || Pat.isJeroo(RIGHT)
|
|