List<String> list = new List<String>
1.普通for循环遍历
for (int i=0;i<list.size();i++){ }
2.增强for循环遍历
for (String s:list) { }
3.迭代器遍历
Iterator<String> iterator=list.iterator(); while (iterator.hasNext()){ //迭代器遍历 }
List<String> list = new List<String>
1.普通for循环遍历
for (int i=0;i<list.size();i++){ }
2.增强for循环遍历
for (String s:list) { }
3.迭代器遍历
Iterator<String> iterator=list.iterator(); while (iterator.hasNext()){ //迭代器遍历 }