Iterator迭代器

Iterator接口共包含4个方法: public interface Iterator<E> { E next(); boolean hasNext(); void remove(); default void forEachRemaining(Consumer<? super E> action){}; } 1. 反复调用next()方法就可以逐个的遍历集合中的
相关文章
相关标签/搜索