public class Tester {
public static void main (
String[] args) {
int x = 5;
Integer x1 = x; Integer x2 = x;
int x3 = new Integer(5);
System.out.print(x2 == x1);
System.out.print(x2 == x3);
System.out.print(x2.equals(x3));
}
}
What is the result?
A) true, true, true
B) false, false, true
C) Correct result not listed
Why is the answer A? After all x3 stores and address different from the one stored in x2. Right?
[ May 26, 2006: Message edited by: Firas Zureikat ]