-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.java
More file actions
37 lines (32 loc) · 826 Bytes
/
Copy pathtest.java
File metadata and controls
37 lines (32 loc) · 826 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
32
33
34
35
36
37
package sort;
import Util.Util;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.concurrent.CopyOnWriteArrayList;
public class test {
public static void main(String[] args) {
ArrayList<Integer> b = new ArrayList<>();
b.add(1);
b.add(2);
b.add(3);
b.add(4);
b.add(5);
// Iterator iterator = b.iterator();
// while(iterator.hasNext())
// {
// if(iterator.next().equals(3))
// {
// iterator.remove();
// iterator.next();
// }
// }
for(int i = 0;i<b.size();i++)
{
if(b.get(i) == 5)
{
b.remove(i);
}
}
// CopyOnWriteArrayList<Integer> a = new CopyOnWriteArrayList<>();
}
}