package jse;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Vector;
public class Jlistdemo {
public static void main(String[] args) {
// TODO Auto-generated method stub
//System.out.println("how are you");
//tlist();
//tmecy();
tlinkedlist();
}
public static void tlist() {
List<String> aff = new ArrayList<String>();
aff.add("asfsfdf");
aff.add("howhowhwo");
System.out.println(aff.size());
}
//线程安全
public static void tmecy() {
List<Integer> vector = new Vector<Integer>();
vector.add(2);
vector.add(3);
vector.add(4);
vector.add(5);
System.out.println(vector.indexOf(3));
for(Integer i:vector) {
System.out.println(i);
}
}
//双向链表
public static void tlinkedlist() {
List<String> linkedList = new LinkedList<String>();
linkedList.add("safdafd");
linkedList.add("bbbb");
for(String i:linkedList) {
System.out.println(i);
}
}
}