Our website loads in split second powered by Schema Theme. Thanks to MyThemeShop

Delete a File in Java

To delete a file in Java, get the file handle to the file that you want to delete. To delete a file in particular directory, Construct File Path to that file, get the file handle to delete the file using the path. Use File.delete() from IO library to delete the file. delete() method will return true, if file is deleted successfully, otherwise, it will return false.

File Delete