Writing to a File: If the file does not exist, it is automatically created. : BufferedWriter « File Input Output « Java
- Java
- File Input Output
- BufferedWriter
Writing to a File: If the file does not exist, it is automatically created.
import java.io.BufferedWriter;
import java.io.FileWriter;
public class Main {
public static void main(String[] argv) throws Exception {
BufferedWriter out = new BufferedWriter(new FileWriter("outfilename"));
out.write("asdf");
out.close();
}
}
Related examples in the same category