Collection c=new ArrayList();
c.add(123);
//迭代器遍历集合
Iterator i=c.Iterator();
while(i.hasNext())
{
System.out.println(i.next());
}
//增强for循环 遍历
for(object i:c)
{
System.out.println(i);
}
原文:http://www.cnblogs.com/steel-chen/p/6901597.html