Precedence
Operator precedence defines how an expression evaluates when several operators are present. Java has specific rules that determine the order of evaluation. The easiest one to remember is that multiplication and division happen before addition and subtraction. Programmers often forget the other precedence rules, so you should use parentheses to make the order of evaluation explicit. For example:
a = x + y - 2/2 + z;
has a very different meaning from the same statement with a particular grouping of parentheses:
a = x + (y - 2)/(2 + z);