class People{
public static void main(String[] args)
{
List<Integer> list = new LinkedList<Integer>();
for (int i = 0; i < 5000; i++)
{
list.add(11);
}
long start = System.currentTimeMillis();
int size = list.size();
int c1 = 1;
for (int i = 0; i < size; i++)
{
c1 = list.get(i);
}
System.out.println("普通for方法: " + (System.currentTimeMillis() - start));
long start2 = System.currentTimeMillis();
for (int c2 : list)
{
c1 = c2;
}
System.out.println("增强for方法:" + (System.currentTimeMillis() - start2));
}