How to skip a number of lines when writing to a txt file
<p>I'm making a program that will output lines to a text file. I don't wish to overwrite the file, but that is what my current code does. I just want to go down the number of lines that are already there and write <code>hello</code>. Here is my code:</p>

<pre><code>FileWriter fileWriter = new FileWriter(fileLocation, false);
BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);

while(numberOfLines &gt; compareToNumOfLines) {
    bufferedWriter.newLine();
    compareToNumOfLines++;
}

bufferedWriter.write("hello");
bufferedWriter.close();
</code></pre>

<p>Unfortunately, this just creates spaces where the text used to be. What am I doing wrong?</p>
