Kizspy Question: 49
(Choose 1 answer)
What is the output of the following code snippet?
File f new File("test.txt");
try{
FileReader fr = new FileReader(f);
BufferedReader bf = new BufferedReader(fr);
int k = 2;
String line.
for (int i = 0; i <k; i++) {
line = bf.readLine();
System.out.println(line);
catch (IOException e){
System.out.println(e);
Assumes that test.txt has the content as follows:
Hello
Xin chao
Hallo
Anyong Haseyo
A. Xin chao
B. Hello
C. Hallo
D. Anyong Haseyo