Copy and create files in Java
<p>I'm trying to understand how should I use File class in order to create a new file.</p>

<p>Assuming that I want to copy the file <code>D:\example\file1</code> and having the same file, that will be named now <code>file2</code></p>

<p>Into this folder: <code>D:\example</code>.</p>

<p>First I created file1 By  <code>File file=new File (D:\example\file1);</code></p>

<p>Now, what should I use? a static method of File class? there are the <code>createTempFile
</code> and the <code>createTempFile</code>, but I believe none of them will do I want.</p>
