Delete a file in Java
Description
The following code shows how to delete a file.
Example
// ww w. j a v a2 s . c o m
import java.io.File;
public class Main {
public static void main(String[] args) {
File file = new File("yourFile.txt");
System.out.println(file.delete());
}
}
The code above generates the following result.