We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bfe86dc commit 1b03fe1Copy full SHA for 1b03fe1
ConcurrentSkipListSet5.java
@@ -0,0 +1,26 @@
1
+package ConcurrentSkipListSet;
2
+
3
+import java.util.concurrent.ConcurrentSkipListSet;
4
+import java.util.Iterator;
5
+import java.lang.Iterable;
6
+public class ConcurrentSkipListSet5 {
7
+ public static void main(String[] args) throws Exception {
8
+ ConcurrentSkipListSet<Float> set = new ConcurrentSkipListSet<>();
9
+ set.add(1.09f);
10
+ set.add(2.89f);
11
+ set.add(3.90f);
12
+ set.add(4.98f);
13
+ // iterator
14
+ Iterator<Float> it = set.iterator();
15
+ while(it.hasNext()){
16
+ System.out.println(it.next());
17
+ }
18
+ // iterable
19
+ Iterable<Float> iterable = set;
20
+ Iterator<Float> it1 = iterable.iterator();
21
+ while(it1.hasNext()){
22
+ System.out.println(it1.next());
23
24
25
+}
26
0 commit comments