
The complete Operator
Precedence Chart is pro-
vided in Appendix B.
REFERENCE POINT
5.1 Forming Conditions 211
TABLE 5.3 Logical Operators
Logical Operator Type Meaning
! unary NOT
&& binary AND
|| binary OR
This expression tests whether an int variable testScore is at least 90:
testScore >= 90
This code tests whether that test score is less than 60:
testScore < 60
5.1.3 Logical Operators
A common operation in a program is to test whether a combination of condi-
tions is true or false. For these operations, Java provides the logical operators !,
&&, and ||, which correspond to the Boolean logic operators NOT, AND, and
OR. These operators, which are shown in ...