Hello I'm trying to do something -when the user has entered a value other than 1 or 2, that it prompts the user to try again until the user chooses 1 or 2 - once the user has been chosen 1 or 2 make another loop that will go back to the very beginning Here is the code I entered
package Com.mkl; import java.util.Scanner; public class Salut{ public static void main(String[] args) { Scanner lectureClavier=new Scanner(System.in); int str=0; char r=' '; do { do { System.out.println("choisi 1 ou 2"); str=lectureClavier.nextInt(); System.out.println("ressayee"); } while(str!= 1 && str!=2); if (str==1 || str==2){ System.out.println("correct"); } r= lectureClavier.nextLine().charAt(0); System.out.println("aimerais vous revenir au début ? tapé O ou N"); } while(r=='N') ; } }