title: Multi-word scanner input in java?
body: <p>So I'm trying to use if-else statement dependant upon the user's input. It works when the user's input is only one word, however, multiple word inputs go unrecognized and triggers the else statement. How can i resolve this?</p>
  
  <p><pre>
  import java.util.Scanner;</p>
  
  <p>public class MyFirstJavaClass {</p>
  
  <code>public static void main(String[] args) {
      @SuppressWarnings("resource")
      Scanner myScanner = new Scanner(System.in);
      String answer;
      System.out.println("Catch the tiger or run away?");
      answer = myScanner.next();
  
  
           if (answer.equals("Catch the tiger"  )) {
              System.out.println("You've been mauled by a tiger! What were you thinking?");
              answer = myScanner.next();          
  
      } else {
          System.out.println("run away");
      }
    }
  }
  </code></pre>