hey Karthik,
this is a great
thread to read on the post increment operator.
post increment operator but in quick terms.
int a = 1;
int b = 1;
a = a++; //a=a; then add 1 to a, so a=1; the last post increment did happen but did not get assigned to anything
b = b++ + b; //b=b++ + b; b=1 + 2 b=3 same here because it increments after it has done the last thing.
System.out.println(a+ " "+b);
Davy
[ April 19, 2004: Message edited by: Davy Kelly ]