JAVA Program to Write Data Character by Character in File

JAVA Program to Write Data Character by Character in File:

import java.io.*;
class file4
{
 public static void main(String args[])
 {
   File f=new File("cde.txt");
   FileWriter fw=null;
  try
  {

   fw=new FileWriter(f);
   int ch;
   String s="BaronTuts";

   fw.write(s);
  }
  catch(Exception e){}

  finally
  {
      try
      {
   fw.close();
}
catch(Exception e){}
  }
 }
}

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.