bufferedwriter doesn't write to file

Java
// Make sure you close your writer like this:
myWriter.close();
Source

Also in Java: