title: Switch Statement and While Loop
body: <p>I am writing a database program that allows the user to search for employees and it opens up a menu for them.in my Main() I have to prompt the User to press m to open up the menu() or q to open up finalStats() any other input is invalid. My problem is that i can't get a while loop to work properly. whenever i hit m it works and when i hit q it works fine, but whenever i hit a key other than those there's an infinite loop and it just infinitely prints out "Please enter a valid character"</p>
  
  <pre><code>boolean end = false;
      System.out.println("Enter m or M to open menu, otherwise enter q or Q for the final stats");
      String entered = scan.next();
      while (end == false)
      switch(entered)
      {
      case "m":
      case "M":
          menu();
      case "q":
      case "Q":
          finalStats();
          end = true;
      default:
          System.err.println("Please enter a valid character");
      }
  </code></pre>