java iterator使用写法,for写法也不错
List<String> ll = new ArrayList<String>(); Iterator<String> it1 = ll.iterator(); while(it1.hasNext()){ String next = it1.next(); }
//都没有这么写过,换种风格也不错 for(Iterator<String> it2 = ll.iterator(); it2.hasNext();){ String next = it2.next(); }