title: How to append to the end of a file in java?
body: <pre><code>...
  Scanner scan = new Scanner(System.in);
  System.out.println("Input : ");
  String t = scan.next();
  
  FileWriter kirjutamine = new FileWriter("...");
  BufferedWriter out = new BufferedWriter(writing);
  out.write(t)    
  out.close();
  ...
  </code></pre>
  
  <p>if I write sometring into the file, then it goes to the first line. But if run the programm again, it writes the new text over the previous text (into the first line). I want to do: if I insert something, then it goes to the next line. For example:</p>
  
  <pre><code>after 1 input) text1
  
  after 2 input) text1
  
                 text2
  </code></pre>
  
  <p>and so on...</p>
  
  <p>what should i change in the code?
  thanks!</p>