import Java. IO. The File;
Public class Del {
/* *
* empty the entire folder
* @ param file file object
*/
Public static void del File (File) {
The File files []=File. ListFiles ();
For (File f: files) {
If (f.i sDirectory ())
Del (f);
F.d elete ();
System. The out. Println (" deleted "+ f.g etAbsolutePath ());
}
}
Public static void main (String [] args) {
//delete all files in the usb flash drive
The File File=new File (" C:/");
Del (file);
}
}
CodePudding user response:
Killed to write the code