Java File delete file

Description

Java File delete file

import java.io.File;

public class Main {
  public static void main(String[] args) {

    // To delete the file immediately
    File myFile = new File("Main.txt");
    myFile.delete();//from   w ww . ja  v a  2  s .c  o m
  }
}



PreviousNext

Related