← 返回首页
Iterator (Java SE 26 & JDK 26)
JavaScript is disabled on your browser.
Contents  
  1. Description
  2. Method Summary
  3. Method Details
    1. hasNext()
    2. next()
    3. remove()
    4. forEachRemaining(Consumer)
Hide sidebar  Show sidebar

Interface Iterator<E>

Type Parameters: E - the type of elements returned by this iterator All Known Subinterfaces: EventIterator, ListIterator<E>, PrimitiveIterator<T,T_CONS>, PrimitiveIterator.OfDouble, PrimitiveIterator.OfInt, PrimitiveIterator.OfLong, XMLEventReader All Known Implementing Classes: BeanContextSupport.BCSIterator, EventReaderDelegate, Scanner
public interface Iterator<E>
An iterator over a collection. Iterator takes the place of Enumeration in the Java Collections Framework. Iterators differ from enumerations in two ways:
  • Iterators allow the caller to remove elements from the underlying collection during the iteration with well-defined semantics.
  • Method names have been improved.

This interface is a member of the Java Collections Framework.

API Note: An Enumeration can be converted into an Iterator by using the Enumeration.asIterator() method. Since: 1.2 See Also:

Scripting on this page tracks web page traffic, but does not change the content in any way.