Skip to content
Sharp

I/O · interview question

Which class should you wrap around a FileReader to read text efficiently line by line?

Multiple choiceEasy
Choose one answer
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.

Test yourself on I/O

A free test with instant, explained results. No account needed.

Start free test
All I/O questions →