Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

On virtual machines and expected behaviour

Name: Anonymous 2010-05-17 19:44

Ever tried running this on your ENTERPRISE VIRTUAL MACHINE?
Integer a = 1000;
 Integer b = 1000;
 System.out.println("a == b (1000 == 1000): " + (a == b));

 Integer aa = 100;
 Integer bb = 100;
 System.out.println("aa == bb (100 == 100): " + (aa == bb));

Guess what's the output, run it and report back.

Name: Anonymous 2010-05-17 23:02

>>29
In the general case it doesn't specify what == evaluates to, given "equal" or "unequal" Integers. Nitpicking on the definition of undefined doesn't really help your argument. Given two Integers n1, n2; the result of n1 == n2 is implementation defined if both n1, n2 are greater than 127 or less than -128, as intValue gives no guaruntee about reference locations besides these.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List