Hello,
I don't understand why this solution doesn't work . It seems there is a problem with the "Iterator" (it doesn't find the symbol).
Do you have any idea about it ?
Thank you.
package fr.codegym.task.task08.task0801;
/*
HashSet de plantes
*/
import java.util.HashSet;
public class Solution {
public static void main(String[] args) throws Exception
{
HashSet<String> liste = new HashSet<String>();
liste.add("pastèque");
liste.add("banane");
liste.add("cerise");
liste.add("poire");
liste.add("melon");
liste.add("mûre");
liste.add("ginseng");
liste.add("fraise");
liste.add("iris");
liste.add("pomme de terre");
Iterator<String> iterateur = liste.iterator();
while (iterateur.hasNext())
{
String texte = iterateur.next();
System.out.println(texte);
}
}
}