When you initialize an Integer object using a literal value the auto-boxing mechanism uses Integer.valueOf() under the covers.
This method first checks a cache of Integer objects, which contains instances for primitive values -128 up to 127 by default.
If the primitive value passed to the valueOf() method lies within that range, a reference to the cached object is returned, otherwise a new Integer wrapper instance will be created (using the constructor).
In the case of you scenario the valueOf() call made by the auto-boxing mechanism will result in the creation of new Integer objects for i1 and i2, because the cache doesn't contain instance for that particular value. In case of i3 and i4 a cached Integer reference will be assigned. So i1 and i2 will refer to distinct Integer objects to which referential equality doesn't apply, whereas i3 and i4 will refer to the same object, to which referential equality does apply. If you are interested in "meanifull equivalency" you should use the equals() method to compare the Integer objects, and not the == or != operators.
Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.