run java code with System.console class
<p>How i will run this piece of java code????</p>

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

/**
 *
 * @author User
 *
 */

public class login{
    boolean authenticate(String u,char[] c){
        boolean x = false;
        if(u=="soumitra"&amp;&amp;c.toString()=="paas")
        {  x=true;}

        return x;

    }
public boolean login()

{int MAX_LOGINS=2;
  Console con = System.console();
  boolean auth = false;

  if (con != null)
  {
    int count = 0;
    do
    {
      String uname = con.readLine("Enter your username: ");
      char[] pwd = con.readPassword("Enter %s's password: ", uname);
      auth = authenticate(uname, pwd); // authenticate login info
      Arrays.fill(pwd, ' '); // delete password from memory
      con.writer().write("\n\n");  // output a couple of newlines
    } while (!auth &amp;&amp; ++count &lt; MAX_LOGINS);
  }
  return auth;
}
public static void  main(String args[]){
    login obj=new login();
    obj.login();

}
}
</code></pre>

<p>tried to run in Netbeansby rightclicking >>run....</p>

<p>got...
run:
<strong>BUILD SUCCESSFUL (total time: 0 seconds)</strong></p>
