Page 784 - Introduction to Programming with Java: A Problem Solving Approach
P. 784

                750 Appendix 2 Operator Precedence
 5. range comparisons (left to right):
x< y
x <= y
x >= y
x> y
<object> instanceof <class>
6. equality comparisons (left to right):
x == y
x != y
less than
less than or equal to greater than or equal to greater than
conforms to
equal
not equal
7. unconditional boolean or bit AND (left to right): x & y both
8. unconditional boolean or bit EXCLUSIVE OR (left to right):
x ^ y
eitherbutnotboth
9. unconditional boolean or bit OR (left to right):
x | y
10. conditional boolean AND (left to right): x && y
11. conditional boolean OR (left to right): x || y
eitherorboth
both(ifnotresolved)
eitherorboth(ifnotresolved)
12. terniary conditional evaluation (right to left):
x ? y : z
13. assignment (right to left):
if x is true, y, else z
y= x
y += x
y -= x
y *= x
y /= x
y %= x
y <<= n
y >>= n
y >>>=
y &= x
y ^= x
y |= x
n
y←x
y←y +x y←y -x y←y *x y←y /x y←y %x y←y << n y←y >> n y←y >>> n y←y &x y←y ^x y←y |x
Apago PDF Enhancer
Figure A2.1b Operator precedence—part B




















































   782   783   784   785   786