-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFinalStaticTest.java
More file actions
26 lines (16 loc) · 1017 Bytes
/
Copy pathFinalStaticTest.java
File metadata and controls
26 lines (16 loc) · 1017 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
package test;
import java.util.ArrayList;
import java.util.List;
public class FinalStaticTest {
public static final ThreadLocal<List<Integer>> testStaticList1 = ThreadLocal.withInitial(ArrayList::new);
public final ThreadLocal<List<Integer>> testStaticList2 = ThreadLocal.withInitial(ArrayList::new);
public static void main(String[] args) {
System.out.println(FinalStaticTest.testStaticList1.hashCode());
FinalStaticTest finalStaticTest1 = new FinalStaticTest();
FinalStaticTest finalStaticTest2 = new FinalStaticTest();
FinalStaticTest finalStaticTest3 = new FinalStaticTest();
System.out.println(finalStaticTest1.testStaticList1.hashCode() + " " + finalStaticTest1.testStaticList2.hashCode());
System.out.println(finalStaticTest2.testStaticList1.hashCode() + " " + finalStaticTest2.testStaticList2.hashCode());
System.out.println(finalStaticTest3.testStaticList1.hashCode() + " " + finalStaticTest3.testStaticList2.hashCode());
}
}