Talk:Java Programming/Answers to Exercises

From Wikiversity
Jump to navigation Jump to search

The answer to Exercise 1 needs work. Your current explanations says associativity is the same and never really explains associativity vs precedence. Yes multiply and divide have higher precedence to addition, but the multiply goes before the divide because binary operators are left associative (not because of precedence). Similarly the explanation for the assignment operator is not operator precedence but the fact that unary and assignment operators are right associative. See also Operator associativity.