This is the code :
import java.io.*;
class tester {
public static void main(String args[])throws IOException {
File f=new File("d:/testerf.txt");
FileWriter fw=new FileWriter(f,true);
String s="Working";
char buffer[]=new char[s.length()];
s.getChars(0,s.length(),buffer,0);
fw.write(buffer);
}
}
The word working is not appended in the file testerf.txt.Nothing happens to the file.
Why the word working is not appended?
You should close the stream:
fw.close();