I hope Babelfish translated your question correctly...
Originally posted by SmileFish Fish:
System.out.println(i2==startingI);//aa
You are comparing two different Integer objects.
One (startingI) constructed as
new Integer(25) the other boxed from an integer primitive (the primitive returned from Integer.intValue()), as in
i2 = i2.intValue();
Originally posted by SmileFish Fish:
System.out.println(s==ss);//bb
You are comparing two integer primitives here.
Now, for an interesting variation try the following: change
Integer i=new Integer(25) for
Integer i=25;
Do you understand the result?
[ May 27, 2007: Message edited by: Sergio Tridente ]
[ May 27, 2007: Message edited by: Sergio Tridente ]