About 1,300,000 results
Open links in new tab
  1. Masking password input from the console : Java - Stack Overflow

    Nov 15, 2011 · How to mask a password from console input? I'm using Java 6. I've tried using console.readPassword(), but it wouldn't work. A full example might help me actually. Here's my code: import java.io.

  2. java - Checking Password Code - Stack Overflow

    Write a method that checks whether a string is a valid password. Suppose the password rule is as follows: A password must have at least eight characters. A password consists of only letters and digits. A password must contain at least two digits.

  3. Console readPassword() method in Java with Examples

    Sep 27, 2022 · The readPassword(String, Object) method of Console class in Java is used to read a password or passphrase from the console by providing a formatted prompt. It returns the password in the character array.

  4. How to code a very simple login system with java

    May 18, 2013 · Here is a good login program for the console: import java.util.Scanner; // I use scanner because it's command line. Scanner scan = new Scanner (new File("the\\dir\\myFile.extension")); Scanner keyboard = new Scanner (System.in); String user = scan.nextLine(); String pass = scan.nextLine(); // looks at selected file in scan.

  5. Java: Input and display your password - w3resource

    Apr 1, 2025 · Java programming exercises and solution: Write a Java program to input and display your password.

  6. SOLVED: Mask password with asterisk from console in Java

    Aug 24, 2022 · 2 different ways to mask password with asterisk from console input in Java. Hide password with asterisk in Java. Display asterisk instead of password in Java input

  7. How to Properly Mask Password Input in Java Console Applications

    Masking password input in a Java console application enhances security by preventing unauthorized users from viewing entered passwords. In Java, this can be achieved using the Console class, which provides the readPassword() method to capture password input without displaying it on the screen.

  8. How to Read User Input and Password in Java from command …

    Here is the Java program which will demonstrate how you can use Console class to read input and password from command line. It's much easier than Scanner or BufferedReader which was alternative solution.

  9. Password Masking in the Java Programming Language - Chalmers

    Login screens and login dialog boxes use password masking — a technique to either hide the password as it is being typed or displaying a character (such as an asterisk '*') instead of the characters that users type.

  10. How to Mask Password Input in Java 5 - CodingTechRoom

    In Java 5, you can easily create password input fields that mask user inputs using the `JPasswordField` class from the Swing library. This class allows you to display the password as asterisks or any other character that you prefer when the user types their password.

Refresh