Home »
MCQs »
Java MCQs
Which method deletes a file in Java?
41. Which method deletes a file in Java?
- file.delete()
- file.remove()
- file.garbage()
- file.dump()
Answer: A) file.delete()
Explanation:
The file.delete() method is used to delete a file in Java.