public class ArrayIterator<E>
extends java.lang.Object
implements java.util.Iterator<E>
Iterator
interface
for an array of objects.Modifier and Type | Field and Description |
---|---|
private E[] |
array
The array to iterate.
|
private int |
index
The index of the next element to return.
|
Constructor and Description |
---|
ArrayIterator(E[] array)
Create a new
ArrayIterator object. |
private final E[] array
private int index
public ArrayIterator(E[] array)
ArrayIterator
object.array
- Array to set.