How can we delete all files in a directory Java?

How can we delete all files in a directory Java?
Answer
Use the listFiles() method of the File class to iterate through all the files in the directory. The File classes delete() method is then used to delete each file.
 

Tìm kiếm

Back
Top