The Console class

The Java.io.Console class provides methods to access the character-based console device, if any, associated with the current Java Virtual Machine. This class is attached to the System console internally. Console class provide means to read text and passwords from the console. To read a line as a String: Console console = System.console(); String myString = console.readLine(); To read a password as an array of chars: Console console = System.console(); char[] pw = console....

April 27, 2017 · 1 min · Rezha Julio