Unable to get particular output in a file
<pre><code>File outputFile2 = new File("money2.txt");
    BufferedWriter outData2 = new BufferedWriter(new FileWriter(outputFile2));
    for(int i = 0 ; i &lt; 4 ; i++)
    {
        System.out.println(ts[i].getMoney());
        outData2.write("TESTING");
        outData2.write(ts[i].getMoney());
        outData2.newLine();
    }
    outData2.close();
</code></pre>

<p>This is my code. In my console I get</p>

<pre><code>20000
10000
10000
4000
</code></pre>

<p>Which is exactly what I want in my file. But instead, I get this in <code>money2.txt</code>:</p>

<pre><code>TESTING?
TESTING?
TESTING?
TESTING?
</code></pre>

<p><em>(Testing is there for debugging purposes)</em></p>

<p>I can't figure out how to debug this. My file is being written to correctly (since 'TESTING' is getting printed. My array is being read from correctly (since output to the console is correct.</p>

<p>What is going wrong?</p>
