title: String comparison fails while using Scanner
body: <p>I have looked online and all of the tutorials / questions have pointed me to this. I can't see why this isn't working. Any help would be much appreciated. Thanks</p>
  
  <pre><code>import java.util.*;
  
  public class test {
      static Scanner userInput = new Scanner(System.in);
      public static void main(String[] args) {
          String textEntered = userInput.next();
          if (textEntered == "hello") {
              System.out.println("Hello to you too!");
          }
      }
  }
  </code></pre>
  
  <p>I enter "hello" but nothing is printed. Also I have tried next() and nextLine();</p>