Java program for cteating a text file
Program import java.io.File; class test { public static void main(String[] args) { try { Writer output = null; File file = new File("E:\\testdemo.txt"); output = new BufferedWriter(new FileWriter(file)); for(int i=0;i<1;i++) { output.close(); System.out.println("file writtern"); } } catch(Exception ex) { System.out.println(ex); } }