|
-
October 7th, 2011, 09:40 PM
#1
BufferedWriter Issue
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|