标签:list public main array next print move oid pre
public class IteratorTest { public static void main(String[] args) { List<String> list = new ArrayList<String>(); list.add("aaa"); list.add("bbb"); list.add("ccc"); Iterator<String> iterator = list.iterator(); while (iterator.hasNext()) { String test = iterator.next(); if ("aaa".equals(test)) { iterator.remove(); } } for (String s: list) { System.out.print(s); } } }
标签:list public main array next print move oid pre
原文地址:http://www.cnblogs.com/cc-java/p/6530524.html