1,迭代器:
ArrayList<String> al = new ArrayList<String>();
Iterator<String> it = al.iterator();
while(it.hasNext()){
String s = it.Next();
System.out.println(s);
}
2,增强for循环:
ArrayList<String> al = new ArrayList<String>();
for(String s : al){
System.out.println(s)