import java.io.Console;
class ReadPasswordFromConsole {
public static void main(String[] args) {
Console c = System.console();
System.out.println("Enter the Password");
char[] ch = c.readPassword();
String password = String.valueOf(ch);
System.out.println("The password is : " + password);
}
}