title: How to return to main menu with switch cases
body: <p>I need to return to main menu when 3 is selected. My main menu code is another loop that I have not included as code but I just want to return to it.(The first loop is in main).</p>
  
  <p>Here is my code:</p>
  
  <pre><code>public static void addEvent() {
      while (true) {
          boolean valid = false;
  
          do {
              Scanner sc = new Scanner(System.in);
              System.out.println("What type of event is it?");
              System.out.println("Lecture = 1. \nWorkshop = 2. \nReturn to Main Menu = 3. \nExit Program = 4. \nINPUT : ");
              int action = sc.nextInt();
              valid = true;
  
              switch (action) {
                  case 1:
                      valid = true;
                      lectureEvent();
                      break;
                  case 2:
                      valid = true;
                      workshopEvent();
                      break;
                  case 3:
                      valid = true;
                      break;
                  case 4:
                      valid = true;
                      return;
                  default:
                      valid = false;
                      System.out.println("ERROR : Choice " + action + "Does not exist.");
                      System.out.println("Please choose an alternative.");
              }
          } while (!valid);
      }
  }
  </code></pre>