Till 127 Java will cache the values and hence i1 and i2 will refere to same single Integer(10) object in heap. But when you do i3 = new Integer(10) you are telling the compiler to create a new integer object. And hence in the above code i1 == i3 you get false instead of getting true.
Only during autoboxing as with i1 and i2 java will cache the values and make the references to point to same immutable 10 value. Thanks Deepak