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.
after fixing those errors:
expected output: a == b (1000 == 1000): false
aa == bb (100 == 100): false
actual output: a == b (1000 == 1000): false
aa == bb (100 == 100): true
Name:
Anonymous2010-05-17 20:14
As is: Needs libraries and public class frame
With necessary corrections: a == b (1000 == 1000): false
aa == bb (100 == 100): true
But this is not correct because you fudged the object constructor for the wrapper class.
After corrections to the Integer wrapper class (e.g., Integer a = new Integer("1000");): a == b (1000 == 1000): false
aa == bb (100 == 100): false
Essentially your shoddy coding failed, not the language. Good day.