Write character to a file using FileWriter in Java
Description
The following code shows how to write character to a file using FileWriter.
Example
import java.io.FileWriter;
import java.io.IOException;
/*from w w w . j a va 2 s. c o m*/
public class Main {
public static void main(String[] a) throws Exception{
FileWriter writer;
writer = new FileWriter("myFile.txt");
char c = 'A';
writer.write(c);
writer.close();
}
}