Which class allows you to read lines of text from a file?

  • BufferedReader
  • FileReader
  • InputStreamReader
  • Scanner
The BufferedReader class is commonly used for reading lines of text from a file in Java. It provides methods like readLine() that allow you to read a complete line of text at a time. While other classes like FileReader and Scanner can also be used for reading files, BufferedReader is preferred for its efficiency and ease of use when reading lines of text.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *