以前我们在遍历元素时,一般情况下是采用以下格式:
Collection coll = new ArrayList();
coll.add("a1");
coll.add("a2");
coll.add("a3");
coll.add("a4");
for (Iterator it = coll.iterator(); it.hasNext();) {
Object obj = it.next();