How To Accept Password From Console in Java

How To Accept Password From Console in Java

Note: This article will be emailed to your friend.

Finally you can easily accept password from console in Java, without echoing them.
This long unmet need has been addressed in JDK 1.6 codeline.

A new class - java.io.Console has been defined to handle console I/O.
To accept password from console in JDK 6.0 (aka JDK 1.6) use either:
public char[] readPassword()
or
public char[] readPassword(String fmt, Object… args)

Sample code:
[...]

Read the rest of this article (115 words)

Please fill in the following fields

* - Required

Your Name: *

Your E-Mail: *

Your Remarks:

Friend's Name: *

Friend's E-Mail: *

Protected by Comment Guard Pro