posted 17 years ago
Actually my confusion is about == & !=
all the four variables i1 ,i2 ,i3 ,i4 have equal contents.so equals() is true.
for == ,means references ,for all are different but for 1 pair ,it says true ,for 1 is false.why that so.
K& B book ,Chap 3 pg 236 says,
---------------------------
in order to save memory ,if primitve value is same for two wrapper objects, it will be ==
---------------------------------
then program output should be true for both pairs, i1=i2 ,i3=i4.
thank you