forked from rangken/AlgorithmStudy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.java
More file actions
27 lines (24 loc) · 684 Bytes
/
Copy pathmain.java
File metadata and controls
27 lines (24 loc) · 684 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
//import java.util.LinkedList;
//import java.util.Iterator;
public class main{
static public void main(String argv[]){
LinkedList<String> l = new LinkedList<String>();
l.add("A");
l.add("B");
l.add("C");
l.remove("A");
System.out.println("-----LinkedList-----");
for(Iterator<String> i = l.iterator(); i.hasNext();){
String str = i.next();
System.out.println(str);
}
System.out.println("-----ArrayList-----");
ArrayList<String> a = new ArrayList<String>();
a.add("A");
a.add("B");
for(Iterator<String> i = a.iterator(); i.hasNext();){
String str = i.next();
System.out.println(str);
}
}
}