
What is BufferedReader used for?

BufferedReader read text from a character-input stream, buffering characters so as to provide for the efficient reading of characters, arrays, and lines. It can read data from the file and console.
Here is an example:
import java.io.*;
class BufferedReaderExample{
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new FileReader("C:/Hello.txt"));
String line="";
while((line = in.readLine()) != null){
System.out.println(line);
}
in.close();
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.