I/O · interview question
Which class should you wrap around a FileReader to read text efficiently line by line?
Multiple choiceEasy
Answer and explanation
Correct answer
A. BufferedReader
Why
BufferedReader buffers characters and provides readLine(). In modern code, Files.newBufferedReader(path) or Files.lines(path) do the same with an explicit charset.
References
Test yourself on I/O
A free test with instant, explained results. No account needed.