new FileWriter(String fileName, boolean append)
public FileWriter(File file,boolean append) throws IOException
- Constructs a FileWriter given a File object. If the second argument is true, then bytes will be written to the end of the file not the beginning.
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("filename", true));
out.write("aString");
out.close();
}
}
Home
Java Book
File Stream
Java Book
File Stream
FileWriter:
- FileWriter
- new FileWriter(File file)
- new FileWriter(String string)
- new FileWriter(String fileName, boolean append)
- FileWriter: close()
- FileWriter: flush()
- FileWriter: write(int i)