[Débutant] implémentation d'Iterator
Voila, j'ai besoin d'implémenter l'interface Iterator (on ne peut pas utiliser les java.*, excepté java.util.ArrayList) pour pouvoir l'utiliser correctement pour manipuler une ArrayList. Voici son interface :
Code:
1 2 3 4 5 6 7 8 9
| public interface Iterator{
/**Returns true if the iteration has more elements.*/
public boolean hasNext();
/**Returns the next element in the iteration.*/
public Object next() throws NoSuchElementException;
} |
je suppose que je dois utiliser un tableau pour l'implémenter? Je suis un peu perdu...