How do I prevent input from being visible on the display console in Java? I, for instance, want to take some private info as input from the user, but don't want to make it visible to the people around him.
Asked
Active
Viewed 581 times
0
-
similar question : http://stackoverflow.com/questions/8138411/masking-password-input-from-the-console-java – RahulB Nov 14 '14 at 16:58
1 Answers
0
You can use the Console class and use the readPassword() method. When user enters data, it will be replaced with asterisks.

Zymus
- 1,673
- 1
- 18
- 38