title: Method call resumes flow --Java
body: <p>My program calls for a menu requires the user's input to go to the correct method, and returns to the menu to allow other methods to be used or to quit the program</p>
  <pre><code>            System.out.println(&quot;Start of menu options&quot;);
              System.out.println(&quot;Enter your command (quit, print reverse, replace all, replace single, remove)&quot;);
              userChoice = sc.nextLine();
              if(userChoice.equalsIgnoreCase(&quot;print reverse&quot;)){
                  printReverse(userString);
  
              }
              if(userChoice.equalsIgnoreCase(&quot;replace all&quot;)){
                  replaceAll(userString);
              }
              if(userChoice.equalsIgnoreCase(&quot;remove&quot;)){
                  remove(userString);
              }
              if(userChoice.equalsIgnoreCase(&quot;replace single&quot;)){
                  replaceSingle(userString);
              }
              if(userChoice.equalsIgnoreCase(&quot;quit&quot;)){
                  quit();
              }
              menu();
  
          }
  </code></pre>
  <p>The reverse() method returns the user to the menu without issue</p>
  <pre><code>            List&lt;Character&gt; temp = new ArrayList&lt;&gt;();
              for(char ch : a.toCharArray()){
                  temp.add(ch);
              }
              Collections.reverse(temp);
              System.out.println(&quot;The new sentence is: &quot;+temp.stream().map(i-&gt;i.toString()).collect(Collectors.joining()));
              menu();
          }
  </code></pre>
  <p>But the remaining methods all seem to bypass the scanner .nextLine() because they will end the program without the looping menu() command, but on the second loop through it will prompt for user input for the scanner call.</p>
  <pre><code>public static void replaceAll(String a){
              System.out.println(&quot;Enter Char&quot;);
              String charToBeReplaced = sc.next();
              System.out.println(&quot;New Char&quot;);
              String charReplacement = sc.next();
              userString = a.replaceAll(charToBeReplaced, charReplacement);
              System.out.println(&quot;Your new sentence is: &quot; + userString);
              menu();
          }
  </code></pre>
  <p>Going through the debugger I can see that userChoice is empty by the time the program gets to checking if userChoice is equal to &quot;quit&quot; but the program runs the two println commands</p>