-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTask221.java
More file actions
31 lines (24 loc) · 810 Bytes
/
Task221.java
File metadata and controls
31 lines (24 loc) · 810 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
public class Task221 {
public static void main(String[] args){
Task221 t = new Task221();
t.methodA();
}
public Integer startingI;
public void methodA()
{
Integer i = new Integer(25);
System.out.println(System.identityHashCode(i));
System.out.println(System.identityHashCode(startingI));
startingI = i;
System.out.println(System.identityHashCode(startingI));
methodB(i);
}
private void methodB(Integer i2)
{
System.out.println(System.identityHashCode(i2));
i2 = i2.intValue();
System.out.println(System.identityHashCode(i2));
System.out.println("i2 == startingI: "+(i2 == startingI));
System.out.println("i2 == startingI: "+i2.equals(startingI));
}
}