Possible Duplicate:
What are the rules for evaluation order in Java?
a = f(b) * - d + e++ + f(e)
Just curious how this would go about evaluating step by step and where could I find the rules for doing so?
Possible Duplicate:
What are the rules for evaluation order in Java?
a = f(b) * - d + e++ + f(e)
Just curious how this would go about evaluating step by step and where could I find the rules for doing so?
SECOND EDIT: My answer is apparently wrong, see the link Adam Liss provided in the comments to the question (has now been moved to the question itself, see "possible duplicate"). I'm leaving my answer here for the details Niklas provided, along with my (incorrect) answer to see what sparked the comments.
If I'm not mistaken, the evaluation tree is built according to the order of operator precedence and then evaluated accordingly. Method calls should be the very first thing to evaluate though, since the return values may be required in the expression.
EDIT: evaluation (assuming sums really are evaluated left-to-right) would look like this (the "intermediate value" called t is what the current value after each step is):
evaluate f(b)
calculate t = f(b) - d
calculate t = t + e (since it's e++ and not ++e)
evaluate e++
evaluate f(e)
calculate t = t + f(e)
assignment a = t