Hi Slobo,
Always keep in mind that objects created by autoboxing will go into constant pool created by JVM when the integer value falls in the range between -128 to 127 otherwise objects are created on heap.
The objects created using new always goes on heap so each object have different memory location even if thay have same integer value and falls in the range between -128 to 127. so == operator evaluates to false.
I modified your code for explaination purpose.
See the code given below.
Ouput is given below
i1 and i2 are the same according to ==
i1 and i2 are the same according to .equals
i3 and i4 are the same according to ==
i3 and i4 are the same according to .equals
i5 and i6 are not the same according to !=
i5 and i6 are the same according to .equals
i7 and i8 are not the same according to !=
i7 and i8 are the same according to .equals
i9 and i10 are not the same according to !=
i9 and i10 are the same according to .equals
i11 and i12 are not the same according to !=
i11 and i12 are the same according to .equals
Also do a seach this forum on "autoboxing","constant pool" you will get autoboxing and comparison of autoboxed object explained many times before.