Java中for循环遍历List的两种方法
常用的方法:
Listpeople = ...; for (int 1=0;i 相当于:
Listpeople = ...; for (Person person : people){ person.setEat("吃饭"); }

Java中for循环遍历List的两种方法
常用的方法:
Listpeople = ...; for (int 1=0;i 相当于:
Listpeople = ...; for (Person person : people){ person.setEat("吃饭"); }