 |
Precedence determines which of the different operators +, /, etc. used in an expresssion, are carried out first. When evaluating expressions java applies the usual algebraic precedence rules.
- Calculate terms inside brackets
- Multiplication, Division and Modulus
- Addition and Subtraction
In the event of equal precedence, work from left to right.
|
|
Evaluates to 38
|
Adding brackets changes the order of evaluation. When brackets are nested the inner one is evaluated first.
|
 |