Created
June 21, 2015 09:58
-
-
Save sachin-handiekar/3fae7beb2da387ab0ad9 to your computer and use it in GitHub Desktop.
Create temporary file in Java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.javaee.insight; | |
| import java.io.File; | |
| import java.io.IOException; | |
| public class CreateTempFileTest { | |
| public static void main(String[] args) { | |
| try { | |
| // create a temp file | |
| File temp = File.createTempFile("sample", ".tmp"); | |
| System.out.println("Temp file : " + temp.getAbsolutePath()); | |
| } catch (IOException e) { | |
| e.printStackTrace(); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment