Hello there,
Java is a Stack Based Language
i=i++;
so what happens here is that
1) i value is stored in top of stack
2) Now the valued in top of stack is pushed backed to the variable that is old value itself
3) Now a new valued in created incementing it in another location(not the value in top of the stack is not effected)
This is differnt in other languages like C, C++.(I hope that made u confused).
so have the value incremented u have to use
i = ++i;
so what happens here is that
1) i value is stored in top of stack
2) Now a new valued in created incementing it in same location(note that value in top of the stack is effected)
3) Now the valued in top of stack is pushed backed to the variable that is new inremented value
KINDLY POINT OUT IF AM WRONG AT ANY POINT
regs
Vivek K Nidhi