New course! Every coder should learn Generative AI!
Try a free lesson+ 4
Check for class Java.io.BufferedReader.
BufferedReader is classified as buffered I/O streams more specifically reads text from a character-input stream, buffering characters so as to provide for the efficient reading of characters, arrays, and lines.
readline is method to help you read data from a file per line.
==============
Example reading a file
BufferedReader br = new BufferedReader(new FileReader("test.txt"));
try {
String line;
while ((line = br.readLine()) != null) {
// process the line
}
} finally {
br.close();
}