title: JAVA Do/while loop not returning the value
body: <p>I'm new at stackoverflow and coding.
  I'm trying to make a method for validating the user input. The user is only allowed to answer, add, show or exit. But I keep getting stuck in the first while loop.
  I tried to change it to !userChoice.equals.. but it is not working.
  What am I doing wrong.</p>
  <pre><code> public static String userFunction() {
          Scanner sc = new Scanner(System.in);
          String userChoice = &quot;test&quot;;
          do {
              userChoice = sc.next().toLowerCase();
              while (userChoice.equals(&quot;add&quot;) || userChoice.equals(&quot;exit&quot;) || userChoice.equals(&quot;show&quot;)) {
                  System.out.println(&quot;Please fill in add, show or exit&quot;);
                  userChoice = sc.next().toLowerCase();
              }
              while (!userChoice.equals(&quot;add&quot;) || !userChoice.equals(&quot;show&quot;) || !userChoice.equals(&quot;exit&quot;)) ;
              return userChoice;
          } while (userChoice == &quot;test&quot;);
      }
  </code></pre>