I want to make a loop that will print wrong answer each time answer is not 1 2 3 or 4 .... and I want it to run infinitly, mine don't detect if the answer is right or wrong it just print out invalid answer, then asks again, then crash! I don't know why it does that.
Here's my code don't read the "text" part because it's in French just look a the code!
System.out.println("Veuillez Choisir 1 des 4 groupes alimentaires suivants: (1)Légumes et fruits , (2) Produit cérealiers , (3) Laits et Substitues , (4) Viandes et substitues :");
System.out.println("\n");
answer = Clavier.lireIntLn();
do {
System.out.println("Votre choix est invalide");
System.out.println("Veuillez Choisir 1 des 4 groupes alimentaires suivants: (1)Légumes et fruits , (2) Produit cérealiers , (3) Laits et Substitues , (4) Viandes et substitues :");
answer = Clavier.lireIntLn();
continue;
}while (answer<1 && answer>5);
continuedo-whileorcontinueis something awful.