I was reading about Console
class, and in the very first line, it was written
New to Java 6 and when we are running
Java SE 6
from command line, then we are typically using console class object
So, which means we are implicitly using console class through the command line ??
Then, I started looking for more detail about Console class and I found Input from console class in java and Console link. So, concluded some points
- Console class are only usable outside the IDE using
System.console().readLine();
Console
class reads a password or passphrase from the console with echoing disabled usingreadPassword()
Although, we had Scanner class and BufferedReader class to read the input from console and that was added earlier than Java 5
. So, only due to security reason Console
class was added in Java 6
? or are there any other advantage(s) to use this class.
Could anyone share more details about Console
class ?