title: Unable to write to a file
body: <p>I have gone through all the related posts in this forum and also googled but not found the exact answer.</p>
  <p>When running the below code, I get following error:</p>
  <blockquote>
  <p>The constructor BufferedWriter(FileWriter) is undefined</p>
  <p>The constructor FileWriter(String) is undefined</p>
  </blockquote>
  <pre><code>public class FileWriter {
      public static void main(String[] args) {        
          BufferedWriter f = null;
  
          try
          {
              f = new BufferedWriter(new FileWriter(&quot;C:\\A.txt&quot;));
              f.write(&quot;Hello World&quot;);
          }
          catch(IOException e)
          {
              System.out.println(e);
          }
          finally
          {
              f.close();  
          }
      }
  }
  </code></pre>