title: When are Java temporary files deleted?
body: <p>Suppose I create a temporary file in Java with the method</p>
  
  <pre><code>File tmp = File.createTempFile(prefix, suffix);
  </code></pre>
  
  <p>If I do not explicity call the <code>delete()</code> method, when will the file be deleted?</p>
  
  <p>As an intuition, it might be when the JVM terminates, or <em>earlier</em> (by the Garbage Collector), or <em>later</em> (by some Operating System sweeping process).</p>