Eclipse result:public class calTest {
public int i = 1;private int j = 1;
public static void main(String[] args) {
new calTest().runCal();
}
public void runCal() {class cal{
cal(){
System.out.println("before i = " + i);System.out.println("before j = " + j);i+=i+=1;j+=j+=1;System.out.println("i = " + i);System.out.println("j = " + j);}
}
new cal();}
}
3
3
NetBean result:
3
4
Command line result:
3
4
Why is it different?
Which result should be the correct one?
Can anyone explain it in detail?
Thank you very much in advance.