posted 19 years ago
I'm assuming the 'ii' is a typo (else it won't compile), and that the line actually reads as follows:
If so, the logic is as follows:
i = 3 * (2 + 3); // i++ evaluates to the original value of i
i = 3 * 5;
i = 15;
Does that help? I can probably guess the next question, though. It's, "where did my incremented value go?", right? Good question!
It helps to understand the difference between variables and an operand stack. I'll write up the steps from a bytecode point of view...
Hope this helps...
[ October 31, 2005: Message edited by: Steve Morrow ]