Reading Data From Keyboard: Inputstreamreader Class
Reading Data From Keyboard: Inputstreamreader Class
There are many ways to read data from the keyboard. For example:
InputStreamReader
Console
Scanner
DataInputStream etc.
InputStreamReader class
InputStreamReader class can be used to read data from keyboard.It performs two tasks:
BufferedReader class
BufferedReader class can be used to read data line by line by readLine() method.
If you read password using Console class, it will not be displayed to the user.
The java.io.Console class is attached with system console internally. The Console class is
introduced since 1.5.
String text=System.console().readLine();
System.out.println("Text is: "+text);