import java.util.*;
public class ArrayListDemo
{
public ArrayListDemo()
{
ArrayList ar = new ArrayList();
ar.add("A");
ar.add("B");
ar.add("C");
ar.add("D");
ar.add("A");
System.out.println(ar);
Iterator i = ar.iterator();
while(i.hasNext())
{
System.out.print(i.next()+" ");
}
Collections.sort(ar);
System.out.println(ar);
Collections.synchronizedList(ar);
System.out.println(ar);
}
public static void main(String[] args)
{
new ArrayListDemo();
}
}
No comments:
Post a Comment