help with if statement
<p>Hey guys im just messing around and I cant get this to work:</p>

<pre><code>public static void main(String[] args){
    Scanner input = new Scanner (System.in);
    String x = "hey";
    System.out.println("What is x?:  ");
    x = input.nextLine();
    System.out.println(x);
    if (x == "hello")
        System.out.println("hello");
    else
        System.out.println("goodbye");
}
</code></pre>

<p>it is of course supposed to print hello hello if you enter hello but it will not.  I am using Eclipse just to mess around.  A little quick help please</p>
