5.3. Precedence and Associativity Rules for Operators
Precedence and associativity rules are necessary for deterministic evaluation of expressions. The operators are summarized in Table 5.2. The majority of them are discussed in subsequent sections in this chapter.
Table 5.2. Operator Summary
Postfix operators
[] . (parameters)expression++expression--
Unary prefix operators
++expression--expression+expression-expression~ !
Unary prefix creation and cast
new (type)
Multiplicative
* / %
Additive
+ -
Shift
<< >> >>>
Relational
< <= > >= instanceof
Equality
== !=
Bitwise/logical AND
&
Bitwise/logical XOR
^
Bitwise/logical OR
|
Conditional AND
&&
Conditional OR
||
Conditional
?:
Assignment
= += -= *= /= %= <<= >>= >>>= &= ^= |=
You are currently reading a PREVIEW of this book.
Get instant access to over
$1 million worth of books and videos.