Iterator迭代器

Iterator接口共包含4個方法: public interface Iterator<E> { E next(); boolean hasNext(); void remove(); default void forEachRemaining(Consumer<? super E> action){}; } 1. 反覆調用next()方法就可以逐個的遍歷集合中的
相關文章
相關標籤/搜索