Java "if" statement
<p>Here is my current code:</p>

<pre><code>
import java.util.Scanner;
public class Random {
  public static void main(String ars[]){
        Scanner input = new Scanner(System.in);
        System.out.println("Welcome"); 
        hey = input.nextLine();

        if(hey == "M"){
            System.out.println("Yup");
        }else{ 
            System.out.println("Nope"); 
        }
    }
}
</code></pre>

<p>I am very new to Java, and to me, this looks like it should work, but Java is telling me "hey cannot be resolved to a variable. </p>

<p>I looked through some different Java reference guides on the internet, and thought for a while, and I still can't figure out why it won't work.</p>
