View Single Post
  #4 (permalink)  
Old 08-04-2007, 10:18 PM
henry_78 henry_78 is offline
Member
 
Join Date: Aug 2007
Posts: 47
henry_78 is on a distinguished road
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.
Reply With Quote