Sometimes you need to crate temp files and clean memory
java.io.File library helps to do this

Example:

1
2
3
4
5
6
try{
File tempFile = File.createTempFile("tempFileName", ".tmp");
System.out.println(tempFile.getAbsolutePath());
}catch(IOException ex){
ex.printStackTrace();
}

This code create file like tempFileName31231.tmp