Why? What is it means?
If you go through docs than you got this reasons.
For stronger security, it is recommended that the returned character array be cleared after use by setting each character to zero.
How can I obtain the inserted password?
You can get password by,
char[] pswd = pswdTextField.getPassword();
String password=new String(pswd);
Or, you can directly print on System.out.print
System.out.print(pswd); // It override ...print(char[]) method
// without concat with another String.
Edit
Please note that, If you concat char[]
with String
than it will inherit Object.toString()
method.
System.out.print("Password: " +pswd);// It will print like Password: [C@d5c0f9