Iterator和Enumeration
iterator的hasNext()
和 next()
方法用于enumeration的hasMoreElements()
和 nextElement()
iterator<FILE> it = a.itreator();
Enumeration<File> en = new Enumeration<File>(){
@Override
public boolean hasMoreElements(){
return it.hasNext();
}
@Override
public File nextElement(){
return it.next();
}
}