Hello,
I am trying to write to a textfile using the BufferedWriter class. My program is below:
import java.io.BufferedWriter;
import java.io.FileWriter;
public class File_Write {
public static void main(String[] args) throws Exception {
BufferedWriter writer = new BufferedWriter(new FileWriter("file.txt"));
writer.write("First Line Of My File");
writer.close();
}
}
The file.txt is in the same folder as the .java and .class files in the BlueJ project.
I see nothing in the file after the program runs.
Any comments on what I am doing wrong?
Thank you!
jetski100
