Results 1 to 2 of 2
  1. #1
    renu is offline Senior Member
    Join Date
    May 2010
    Posts
    117
    Rep Power
    0

    Question password hiding when entered in the console.

    Hi

    I wrote a program , where user id and password are entered by the user in the console .
    When the password is entered , i dont want it to be displayed.

    Is their any way to do it .

    Java Code:
    private static String f_password(Scanner scan) {
    		System.out.println("Enter password : ");
    		String password = scan.next();  //Scan the input 
    		System.out.println("The given password is :"+password);
    		return password;
    	}
    And i call this method , in the Main Class.

    Thanks in advance.

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,585
    Rep Power
    12

    Default

    After I don't know how many years of people asking for this Java finally provided the Console class to provide this behaviour.

Similar Threads

  1. Replies: 2
    Last Post: 03-23-2010, 05:46 AM
  2. Password hiding
    By C.A.B.A.L. in forum New To Java
    Replies: 4
    Last Post: 03-04-2009, 09:25 AM
  3. how to check password for 3 times enterd wrong password
    By sk.mahaboobbhasha@gmail.c in forum New To Java
    Replies: 2
    Last Post: 11-14-2008, 08:53 PM
  4. how to check password for 3 times enterd wrong password
    By sk.mahaboobbhasha@gmail.c in forum Java Servlet
    Replies: 0
    Last Post: 11-14-2008, 02:22 PM
  5. How to check password of a jsp/html with the password of Database(mysql) #1
    By sk.mahaboobbhasha@gmail.c in forum Java Servlet
    Replies: 2
    Last Post: 11-14-2008, 02:11 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •