I know there are similar posts on the topic, but they don\'t quite address my question. When you do:
Integer a = 10; Integer b = 10; System.out.println(\"a =
It's because you're using the new statement to construct the objetcs.
new
Integer a = Integer.valueOf(10); Integer b = Integer.valueOf(10); System.out.println("a == b: " + (a == b));
That will print out true. Weird, but Java.
true