How to read password in console in Java?
The following illustrates reading password in console in Java which means that password isn't visible when the user is typing.
System.console().readPassword(): The console() method generates a Console object which contains the readPassword() method. This method reads the password from the user into a char array and returns it.class ReadPassword
public static void main(String args)
// Just print, make it simple
System.out.println("The password is "+new String(c));