how to input as asterisk in Java | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

how to input as asterisk in Java

I like to know how to accept input like passwords/ pin codes as asterisk instead of seeing the the characters eg. Phy1233, on the screen. Want to see ********, which represents the same characters. class password { Public static void main (String args[]){ System.out.print(ā€œEnter your password: ā€); (Input code:............... please thanks); } }

23rd Apr 2019, 8:41 PM
KCode SubField
KCode SubField - avatar
2 Respostas
+ 1
I think you can't do this if you want to enter password from terminal.. You can use some java libraries as Swing or JavaFX to enter the password using textfields They give an opportunity to hide a password
23rd Apr 2019, 8:46 PM
Š’Š»Š°Š“ŠøсŠ»Š°Š² ŠšŃ€ŠµŃ†
Š’Š»Š°Š“ŠøсŠ»Š°Š² ŠšŃ€ŠµŃ† - avatar
+ 1
ok any code simple code to assist, am use ā€œJOptionPane libraryā€. thanks
23rd Apr 2019, 9:02 PM
KCode SubField
KCode SubField - avatar