下面是我的代码:
System.out.println("Enter Username: ");
String unm=System.console().readLine();
System.out.println("Enter Password: ");
char[] pwd=System.console().readPassword();
System.out.println("Welcome: " + "" + " Your password is " + new String(pwd));
为什么我会得到这个错误?
输入用户名:在Cons.main(Cons.java:13)
的线程"main“java.lang.NullPointerException中出现异常
https://stackoverflow.com/questions/34555185
复制相似问题