Java examples for File Path IO:Text File
Create FileWriter from path String and write string value to a text file
import java.io.FileWriter; import java.io.IOException; import java.io.Writer; public class FileWriterTest { public static void main(String[] args) throws IOException { Writer writer = null;/*w w w.j a v a 2 s. com*/ try{ writer = new FileWriter("C:/output.txt"); writer.append("from java2s.com"); }finally{ if(writer != null){ writer.close(); } } } }