Iterator<String> lit = list.Iterator();
while (lit.hasNext()) {}
for (int x = 0; x < list.size(); x++) {
String s = (String) list.get(x);
System.out.println(s);
for (Student s : al) {
System.out.println(s.getName() + "***" + s.getAge());
}
常用的有三种 迭代器,普通for,增强for |
|