February 2014
Beginner
1248 pages
62h 25m
English
To develop a better understanding of the rules of operator precedence, consider the evaluation of an assignment expression that includes a second-degree polynomial ax2 + bx + c:
The multiplication operations are evaluated first in left-to-right order (i.e., they associate from left to right), because they have higher precedence than addition. (Java has no arithmetic operator for exponentiation, so x2 is represented as x * x. Section 5.4 shows an alternative for performing exponentiation.) The addition operations are evaluated next from left to right. Suppose that a, b, c and x are initialized (given ...
Read now
Unlock full access