Iterator和Enumeration

时间:2014-05-01 12:59:57   收藏:0   阅读:358

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();

}

}

 

Iterator和Enumeration,码迷,mamicode.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!