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 =
A new instance is a new instance, so they are equal in value, but they are not equal as objects.
So a == b can't return true.
a == b
true
If they were 1 object, as you ask for: a+=2; would add 2 to all int = 10 - that would be awful.
a+=2;
int = 10