I am confused with the reply. int i =0; i = i++; System.out.println(i); Here is what I think the sequence of operations is 1. i=0 and this value is assinged to the RHS and hence i is zero. 2. i is then incremented due to the post fix increment. Shouldn't i then become 1.
System.out.println(i++); it prints 0. if i is zero initially
Even in method call,
meth(i++, i) means-->>> meth(0, 1) if i is initially zero.
jst remember this. first VM stores the value of i which is zero to some temporary location then increments its value by one. So i becomes one, but the value which is assigned to i is again temporary location value.