Opening and Closing a File in RandomAccessFile
<p>I have a program which has to create an empty file with a specific name, write output to it and then close it (not delete it). If the program is run again, the file has to reopen with the same name, and be an empty new clean file.</p>

<p>If I just create a RandomAccessFile with the mode <code>rw</code> and then just use the <code>close()</code> function, will this achieve what I want?</p>

<p>Thank you,</p>
