delete file in java

Delete file in java

import java.io.File;

public class DeleteFile {
public static void main(String[] args) {
File f=null;
String path=”D:\a\hi.txt”;
try {
f=new File(path);
boolean b=f.delete();
System.out.println(“file delete=”+b);
} catch (Exception e) {
System.out.println(e);
}
}
}


Notice: compact(): Undefined variable: limits in /home/javaprof/public_html/wp-includes/class-wp-comment-query.php on line 853

Notice: compact(): Undefined variable: groupby in /home/javaprof/public_html/wp-includes/class-wp-comment-query.php on line 853

Leave a Reply

Your email address will not be published. Required fields are marked *

9 + 1 =