Page 1 of 1

About Question com.enthuware.ets.scjp.v6.2.511 :

Posted: Sun Feb 16, 2014 7:51 am
by devlam
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

Re: About Question com.enthuware.ets.scjp.v6.2.511 :

Posted: Sun Feb 16, 2014 9:34 am
by admin
No, it will not happen with MAX_VALUE.