Primitive Expressions
Know
Java evaluates operators by precedence, not left to right, and the type of the result is determined by the operand types. Mixing an int with a double promotes the result to double.
Apply
Evaluate an expression by resolving parentheses, then multiplication and division, then addition and subtraction, recording the type at each step.
Watch out
Assuming every division keeps its decimal part. Two ints divide to an int no matter what the surrounding expression looks like.
Study move
Trace five expressions that mix int, double, and parentheses, writing the type beside every intermediate value.
