File tree 2 files changed +40
-0
lines changed
2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change
1
+ import java .util .concurrent .ConcurrentHashMap ;
2
+
3
+
4
+ public class ConcurrentHashMapKSV1 {
5
+
6
+ public static void main (String [] args ){
7
+
8
+
9
+ ConcurrentHashMap <Integer , String > map = new ConcurrentHashMap <>();
10
+ map .put (1 , "one" );
11
+ map .put (2 , "two" );
12
+ map .put (3 , "three" );
13
+ map .put (4 , "four" );
14
+
15
+ ConcurrentHashMap .KeySetView <Integer , String > keySetView = map .keySet ();
16
+
17
+ System .out .println (keySetView );
18
+
19
+ }
20
+
21
+ }
Original file line number Diff line number Diff line change
1
+ import java .util .concurrent .ConcurrentHashMap .KeySetView ;
2
+ import java .util .concurrent .ConcurrentHashMap ;
3
+
4
+ public class ConcurrentHashMapKSV2 {
5
+
6
+ public static void main (String [] args ){
7
+
8
+
9
+ ConcurrentHashMap <Integer , String > map = new ConcurrentHashMap <>();
10
+ map .put (1 , "one" );
11
+ map .put (2 , "two" );
12
+ map .put (3 , "three" );
13
+ map .put (4 , "four" );
14
+
15
+ KeySetView <Integer , String > keySetView = map .keySet ();
16
+
17
+ System .out .println (keySetView );}
18
+
19
+ }
You can’t perform that action at this time.
0 commit comments