So I was asked this question today.
Integer a = 3; Integer b = 2; Integer c = 5; Integer d = a + b; System.out.println(c == d);
What will t
It's because some of the (auto-boxed) Integers are cached, so you're actually comparing the same reference -- this post has more detailed examples and an explanation.