June 2025
Intermediate to advanced
1093 pages
33h 24m
English
With parentheses, you can influence the order of calculations within an expression, just like in mathematics. This achieves roughly the same effect as if you were to split the expression into multiple statements. Therefore,
int interest = 3 * (4 + 7) * 8;
is the same as
int intermediateResult = 4 + 7;int interest = 3 * intermediateResult * 8;.
The order of other evaluations (here, *) is not affected.
Read now
Unlock full access