Skip to content

Masking password going wrong #11

@najihahnizar

Description

@najihahnizar

Hi,all. I have been deadlocked in finding solution for my codes.
I have been searching for three days, almost get what I want. Please review my codes below;

private String promptForText(String prompt, Character mask, DataInputStream in, PrintWriter out) throws Exception {
            String line;
            ConsoleReader consoleReader = new ConsoleReader(in, out);
            line = consoleReader.readLine(prompt, mask);
            return line;
        }

String pwd = promptForText("password:",'*',in,out);

The output I get:
password: f*a*c*t*o*r*y*

Thank You So Much.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions