title: How to write content to a file
body: <pre><code>try {
      File file = new File("sample.txt");
      FileWriter fw = new FileWriter(file,true);
      fw.append('d');
      fw.write(100);
      fw.close();
  } catch(IOException exp) {
      exp.printStackTrace();
  }
  </code></pre>
  
  <p>I am unable to append or write anything to the file.</p>
  
  <p>But I could read the content from the file.</p>
  
  <p>Is anything wrong with my code?</p>