title: How to create a temp file in java without the random number appended to the filename?
body: <p>I need to create a temp file, so I tried this:</p>
  
  <pre><code>String[] TempFiles = {"c1234c10","c1234c11","c1234c12","c1234c13"};
  for (int i = 0; i &lt;= 3; i++) {
      try {
          String tempFile = TempFiles[i]; 
          File temp = File.createTempFile(tempFile, ".xls"); 
          System.out.println("Temp file : " + temp.getAbsolutePath());
      } catch (IOException e) {
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>The output is something like this:</p>
  
  <pre><code> Temp file : C:\Users\MD1000\AppData\Local\Temp\c1234c108415816200650069233.xls
   Temp file : C:\Users\MD1000\AppData\Local\Temp\c1234c113748833645638701089.xls
   Temp file : C:\Users\MD1000\AppData\Local\Temp\c1234c126104766829220422260.xls
   Temp file : C:\Users\MD1000\AppData\Local\Temp\c1234c137493179265536640669.xls
  </code></pre>
  
  <p>Now, I don't want the extra numbers (long int) which is getting added to the file name. How can I achieve that? Thanks </p>