posted 21 years ago
Vikas,
Follow this, as someone explained it to me.
put the operator values in the bracket and operand values outside than drop the values from the bracket, try this you never go wrong.
Int x=1;
Ln1 :System.out.println((++x)+(x++)+(x--)+(--x));
(2)2 + 2(3) + 3(2) + (1)1
Now drop the values from the bracket,
2 + 2 + 3 +1 = 8
Ln2 :System.out.println(x);
the last value of i was '1'
Hope it helps...