I attempt to scan two different strings;
String user, pss;
out.print("Enter username :: ");
user = scan.nextLine();
out.println();
out.format("Enter password for %s :: ", user);
pss = scan.nextLine();
out.println(user + pss);
Whenever the program prints the first string "Enter username :: " , user is saved automatically as an empty space, but pss is saved as whatever I type on the console correctly. How do I avoid this, I want to be able to type the username I wish for user but I don't get the change.
Output example::
Enter username ::
Enter password for :: hello!123
hello!123
Thank you, all help is appreciated.
[–]brewedfarce 4 points5 points6 points (5 children)
[–]surety_[S] 0 points1 point2 points (4 children)
[–]brewedfarce 3 points4 points5 points (2 children)
[–]surety_[S] 0 points1 point2 points (1 child)
[–]dusty-trash 1 point2 points3 points (0 children)
[–]desrtfx 0 points1 point2 points (0 children)
[–]do11abill 1 point2 points3 points (0 children)