Java text file create
import java.io.BufferedWriter; import java.io.FileWriter; public class Main { public static void main(String[] argv) throws Exception { BufferedWriter out = new BufferedWriter(new FileWriter("Main.java")); out.write("demo from demo2s.com"); out.close();//w w w . j a v a2 s . c o m System.out.println("done"); } }