posted 20 years ago
When I run the following in JDK1.2.2, I get the output 1 2. When I run it under JDK 1.4.1, I get the output 1 3. Which is the correct answer and why am I getting different results?
int a = 1;
int b = 1;
a = a++;
b = b++ + b;
System.out.println(a+ " "+b);
Thanks.
Regards,
Kathy