class  ListDemo

{

public static void main(String[] args) 

{

java.util.List list = new java.util.ArrayList();


list.add("aaa");

list.add("bbb");

list.add("ccc");

list.add("ddd");

list.add("eee");


for (int i = 0 ;i<list.size() ;i++ )

{

System.out.println(list.get(i));

}

System.out.println("-----list-------");

list.remove(0);

list.remove(new String("eee"));

java.util.Iterator it = list.iterator();

for (;it.hasNext() ; )

{

System.out.println(it.next());

}


java.util.List list2 = new java.util.ArrayList();

list2.add("aaa");

list2.add("bbb");


java.util.List list3 = new java.util.ArrayList();

list3.add("aaa");

list3.add("bbb");


System.out.println("=======list2============");

for (int j = 0;j<list2.size() ;j++ )

{

System.out.println(list2.get(j));

}

System.out.println("===================");

//list2.removeAll(list2);

for (int j = 0;j<list2.size() ;j++ )

{

System.out.println(list2.get(j));

}


System.out.println(list2.contains(new String("aaa")));

System.out.println(list.contains(list2));

System.out.println(list2.contains(list3));


}

}