Hi Shabbir.Let's go through the code
1)The actual expression can be also written as
since we are using a shorthand operator.When this expression will be evaluated,the CURRENT value of i will be used.Hence the expression will be now i=3*(2+i++);
However,assignment has lower priority than the other operators used in the expression,thus the value 3 will be pushed on stack and the (2+i++) will be evaluated.
2)Now the expression (2+i++) has to be evaluated,which will come to 2+3=5,since a post-fix operator (i++) is used.Hence the expression (2+i++) evaluates to (2+3)
3)Value of i will now be incremented,because of i++.Hence now i=4.
4)Now the stored value is retrieved and it is multiplied with the result obtained in step 2) above.Thus,now the expression becomes i = 3*5, ie i=15, thus overwriting the value of i obtained in step 3) above.
I hope i have been clear enough.
------------------
Udayan Naik
Sun Certified
Java 2 Programmer
[This message has been edited by Udayan Naik (edited March 01, 2001).]