About Question com.enthuware.ets.scjp.v6.2.511 :
Posted: Sun Feb 16, 2014 7:51 am
Nice addition to the explanation is that this is only the case with the minimum and maximum allowed int value.
In this code snippet:
a = Integer.MIN_VALUE + 1;
b = -a;
System.out.println( a+ " "+b);
it will print:
-2147483647 2147483647
In this code snippet:
a = Integer.MIN_VALUE + 1;
b = -a;
System.out.println( a+ " "+b);
it will print:
-2147483647 2147483647