I have below code
try
{
FileWriter fileWriter = new FileWriter(\"C:\\\\temp\\\\test.txt\");
fileWriter.write(\"Hi this is sasi This t
Try this:
import java.io.*;
public class Hey
{
public static void main(String ar[])throws IOException
{
File file = new File("c://temp//Hello1.txt");
// creates the file
file.createNewFile();
// creates a FileWriter Object
FileWriter writer = new FileWriter(file);
// Writes the content to the file
writer.write("This\n is\n an\n example\n");
writer.flush();
writer.close();
}
}