Computer Science, asked by sandeep7428971193, 1 day ago

27. Which of the following statement will create a stream to read text from "a.txt" file line by line? 1. FileReader fr=new FileReader("a.txt"); 2. BufferedReader br=new BufferedReader(new FileReader("a.txt")); 3. FileInputStream fis=new FileInputStream("a.t (A) 1 (B) 2 (C) 3 (D) none​

Answers

Answered by vishwa7313
4

Answer:

Explanation:

How to read file in Java – BufferedReader

author image

By mkyong | Last updated: April 9, 2019

Answered by mousmikumarisl
1

Answer:

The correct answer is option 2) BufferedReader br=new BufferedReader(new FileReader ("a.txt"))

Explanation:

  1. A Java class called BufferedReader reads text from the input stream. To read characters, arrays, etc. efficiently, it buffers the characters.
  2. Since we can use the readline() function to read the data one line at a time, it inherits the reader class and makes the code efficient.
  3. It enables the efficient reading of characters, arrays, and lines by buffering text as it is read from a character-input stream.

#SPJ3

Similar questions