Here no boxing or unboxing need to happen so it doens't happen. Generally when
you compare objects using '==' it checks for reference equality rather its value
equality(done through equals() method of object). But then how i==j returns true
? As String pool even Integer has its own pool or cache.
static
final Integer cache[] = new Integer[-(-128) + 127 + 1];
static
{ for(int i = 0; i < cache.length; i++) cache[i] = new
Integer(i - 128); }
From -128 to 127, values available in the the
pool already, it takes from the pool. And for the values above/below it will
create new object in the heap. Do the same operation for any value above 127 you
will get false as the result.