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.
Loading...
Related Quiz
- A variable declared as double d = 10.3; occupies ________ bytes of memory.
- How does the FileWriter class handle character encoding?
- The class ________ allows an application to read bytes from a file, modifying them, and then writing them back to the file.
- Which of the following statements correctly initializes a two-dimensional array in Java?
- The ________ method of HttpURLConnection class is used to make the connection to the remote object referred by the URL.