title: how to make the menu reappear in while loop
body: <p>How to make the menu reappear if the user doesnt press any key like 3 in this case to exit the program.</p>
  
  <pre><code>import java.util.Scanner;
  
  public class New {
  
      public static void main(String[] args) {
          System.out.println("Enter 1 to create folder/ 2 to create file/ 3 to exit");
          Scanner scan= new Scanner(System.in);
          int choice= scan.nextInt();
                  while(true) {
                      if(choice==1) {
                          System.out.println("Creating folder");
                      }
                      else if(choice==2) {
                          System.out.println("Creating file");
                      }
                      else {
                          System.out.println("Exiting");
                      }
  
  
                  }
  
      }
  }
  </code></pre>