< prev index next >
src/java.base/share/classes/java/util/Iterator.java
Print this page
@@ -21,13 +21,14 @@
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
-package java.util;
+package javany.util;
-import java.util.function.Consumer;
+import java.util.Objects;
+import javany.util.function.Consumer;
/**
* An iterator over a collection. {@code Iterator} takes the place of
* {@link Enumeration} in the Java Collections Framework. Iterators
* differ from enumerations in two ways:
@@ -49,11 +50,11 @@
* @see Collection
* @see ListIterator
* @see Iterable
* @since 1.2
*/
-public interface Iterator<E> {
+public interface Iterator<any E> {
/**
* Returns {@code true} if the iteration has more elements.
* (In other words, returns {@code true} if {@link #next} would
* return an element rather than throwing an exception.)
*
@@ -63,11 +64,11 @@
/**
* Returns the next element in the iteration.
*
* @return the next element in the iteration
- * @throws NoSuchElementException if the iteration has no more elements
+ * @throws java.util.NoSuchElementException if the iteration has no more elements
*/
E next();
/**
* Removes from the underlying collection the last element returned
< prev index next >