I am making a simple program that put data into a file using FileWriter.
But I am facing a problem. My code is creating the fie but not putting data into the file.
import java.io.*;
class Temp
{
public static void main(String args[])throws Exception
{
FileWriter fw=new FileWriter("ma.txt");
BufferedWriter bw=new BufferedWriter(fw);
String str="dslkm dsk";
bw.write(str);
}
}
Why is this happening?