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

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
devlam
Posts: 50
Joined: Sun Nov 10, 2013 4:39 am
Contact:

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

Post 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

Online
admin
Site Admin
Posts: 10398
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post by admin »

No, it will not happen with MAX_VALUE.

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests