Java tutorial
import java.io.Console; public class Main { public static void main(String[] args) throws Exception { Console cnsl = System.console(); if (cnsl != null) { String alpha = cnsl.readLine("Name: "); System.out.println("Name is: " + alpha); char[] pwd = cnsl.readPassword("Password: "); System.out.println("Password is: " + pwd); } } }