|
Hi,
In this implementation u have to increment 'count' when u invoke the next() method, this will help u to know when your collection is finished.
As u can see in your code, the hasNext() method verifies that
count < collection.size();
To iterate another time, u have to create another itaerator...or change your class adding more methods.
Bye.
|