Password is correct Message Doesn't shows up

Discussion in 'Software' started by siddiqui_1985, Jun 24, 2012.

  1. siddiqui_1985

    siddiqui_1985

    Joined:
    Jun 24, 2012
    Messages:
    2
    Hi every one!!

    Sorry about my English. I have a little problem here, i manage to get my password doesn't appear just like in unix/linux do but when i enter password and re-enter the same password it should tell me that password is correct but this message doesn't show up.

    here is my code ::

    import java.io.Console;
    public class PasswordEcho {

    public void pass(){

    Console con = System.console();

    char[] pass1 = null;
    char[] pass2 = null;

    System.out.print("Enter password : ");
    pass1 = con.readPassword();

    System.out.print("Re-enter password :");
    pass2 = con.readPassword();

    if(pass1 == pass2){

    System.out.println("Correct");
    }

    }

    public static void main(String args[]){

    new PasswordEcho().pass();
    }

    }


    thanks
    siddiqui_1985, Jun 24, 2012
    #1
    1. Advertising

  2. siddiqui_1985

    siddiqui_1985

    Joined:
    Jun 24, 2012
    Messages:
    2
    i also tried

    Arrays.equals(pass1,pass2) too but message did not appear
    siddiqui_1985, Jun 24, 2012
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hendrik Maryns
    Replies:
    4
    Views:
    531
    Hendrik Maryns
    Jun 28, 2005
  2. pcbutts1
    Replies:
    2
    Views:
    873
    pcbutts1
    Jul 26, 2005
  3. Jack \(MVP-Networking\).

    Re: printer shows up on network computer but doesn't print

    Jack \(MVP-Networking\)., Dec 7, 2006, in forum: Wireless Networking
    Replies:
    0
    Views:
    408
    Jack \(MVP-Networking\).
    Dec 7, 2006
  4. jim evans

    Correct White Balance Doesn't Mean Correct Color??

    jim evans, Oct 21, 2005, in forum: Digital Photography
    Replies:
    28
    Views:
    958
    Dave Martindale
    Dec 27, 2005
  5. Cix_Design

    Is this correct XP Home Q Password Won't Save

    Cix_Design, Jun 3, 2007, in forum: Wireless Networking
    Replies:
    1
    Views:
    369
    Cix_Design
    Jun 5, 2007
Loading...

Share This Page