6、迭代器的原理

Collection c=new ArrayList();

Iterator it=c.iterator();

注意:这里使用的是子类ArrayList里的获得迭代器的方法,在ArrayList里是采取内部类的方式,实现Iterator接口的方法。

posted @ 2017-04-14 16:38  奋斗的少年WH  阅读(133)  评论(0)    收藏  举报