Hi,
Is it possible to use the Java Scanner to read from STDIN silently? I mean, without outputting any pressed chars to the terminal?
Hi,
Is it possible to use the Java Scanner to read from STDIN silently? I mean, without outputting any pressed chars to the terminal?
You might want to give java.io.Console a look
It has a readPassword method which "Reads a password or passphrase from the console with echoing disabled".
The class java.io.Console may be useful:
System.console().readPassword();
This reads a sequence of chars from the console, without echoing anything. Note that it only works when you launch your java application with a real console. Otherwise, System.console() returns null.