Natallia Bahlai wrote:The second question is
Why i1 == i3 returns false?
When AUTO-Boxing done at line
Integer i3=i2,new object implicitly generated and the int value is assigned to new object.when you trying to compare two different object using
== then it will return false.
Also AUTO-Unboxing will be done while comparing one primitive type with object of respective wrapper class.
But NO AUTO (UNBOXING OR BOXING) operation happen while comparing two object using
== operate.
Hope this will help you Natallia.