import java.io.*;
class File6{
public static void main(String[] s){
try{
File file = new File("f.txt");
FileWriter fw = new FileWriter(file);
fw.write("who is next\nI don't know\nok no problem");
FileReader fr = new FileReader(file);
BufferedReader br = new BufferedReader(fr);
String data;
while((data=br.readLine()) !=null)
System.out.println(data);
br.close();
}catch(IOException io){io.printStackTrace();}
}
}
This code is not showing any output .
I can't make out the problem , please help
Thanks in advnce
class File6{
public static void main(String[] s){
try{
File file = new File("f.txt");
FileWriter fw = new FileWriter(file);
fw.write("who is next\nI don't know\nok no problem");
FileReader fr = new FileReader(file);
BufferedReader br = new BufferedReader(fr);
String data;
while((data=br.readLine()) !=null)
System.out.println(data);
br.close();
}catch(IOException io){io.printStackTrace();}
}
}
This code is not showing any output .
I can't make out the problem , please help
Thanks in advnce