Given the following program:.
import java.io.BufferedReader; import java.io.EOFException; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; public class Main { public static void main(String[] args) { try {// w ww . ja v a2 s . co m FileReader fr = new FileReader("greetings.txt"); BufferedReader br = new BufferedReader(fr); System.out.print(br.readLine() + "|"); System.out.print(br.readLine() + "|"); System.out.print(br.readLine() + "|"); } catch (EOFException eofe) { System.out.println("End of stream"); } catch (IOException ioe) { System.out.println("Input error"); } } }
Assume that the file "greeting.txt" exists in the current directory, has the required access permissions, and contains the following two lines of text:.
Hello Howdy
Which statement is true about the program?.
Select the one correct answer.
(b)
The readLine()
method of a BufferedReader returns null when the end of the stream is reached.