import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
public class Home {
public static void main(String[] args) {
// TODO Auto-generated method stub
Collection<String> c1 = new ArrayList<String>();
c1.add("hello");
c1.add("I");
c1.add("Love");
for (String a : c1) {
System.err.println("第一种:增强For循环 : " + a);
}
Object[] array = c1.toArray();
for (int i = 0; i < array.length; i++) {
System.err.println("第二种:转数组 : " + array[i]);
}
Iterator<String> b = c1.iterator();
while (b.hasNext()) {
System.err.println("第三种:迭代器 : " + b.next());
}
}
}