class TrickyTest {
public static void main (
String args [ ] ) {
int i = 10 ; // line 1
i = ++i ; // line 2
i = i++ ; // line 3
System . out . println ( i ); // line 4
}
};
The output is 11
Now according to the postfix rule i is incremented by 1 after the old value had been assigned to i
So the fact that i is incremented should give us 12 in the output
Please tell me where i am going wrong
Thanks