Masking password input from the console, "Cannot resolve symbol 'console'"
<p>So when ever I try to compile this code, I get: </p>

<p>java: cannot find symbol
symbol:   class console
location: class java.lang.System</p>

<p>I don't understand why when I initiate the console object, System.console() can't be resolved...</p>

<pre><code>import java.io.Console;
import java.util.Arrays;
import java.util.Scanner;


public class User {
    Scanner input = new Scanner(System.in);
    Console console = new System.console();

    private String userID, userPW, userPIN;
    private char[] password = new char[6];


    public String getUserID() {
        return userID;
    }

    public void setUserID(String userID) {
        this.userID = userID;
    }

    public String getUserPW() {
        return userPW;
    }

    public void setUserPW(String userPW) {
        this.userPW = userPW;
    }

    public String getUserPIN() {
        return userPIN;
    }

    public void setUserPIN(String userPIN) {
        this.userPIN = userPIN;
    }

 public void setUserInfo() {
      System.out.print("Please enter your User ID : ");
      this.setUserID(input.nextLine());

      System.out.print("Please enter your Password: ");
      this.setUserPW(input.nextLine());

      this.password = console.readPassword("Enter password");
      Arrays.fill(this.password, '*');
  }
</code></pre>
