what is the difference between delete() and deleteOnExit() methods in java.io.File class in Java?
delete() will delete the file at once, while deleteOnExit() will not delete the file, when you call it. Instead the file is deleted, when the program ends or more precise the virtual machine terminates.
In case the virtual machines terminates not regulary, deleteOnExit() has no effect.