[java学习笔记]Iterator和Iterable接口

    Iterator和Iterable都是java的迭代器接口,两者既有区别又有联系,下面从接口定义,实现和方法调用三方面分析两接口的关系和使用方法。 1.接口定义 1.1 Iterable     Iterable包含在java.lang中,使用时不须要import,其定义以下java public interface Iterable<Item>{ Iterator<Item> i
相关文章
相关标签/搜索