File f = new File("c:\\a.txt");
f.delete();

解决方案 »

  1.   

    delete
    public boolean delete()
    Deletes the file or directory denoted by this abstract pathname. If this pathname denotes a directory, then the directory must be empty in order to be deleted. Returns:
    true if and only if the file or directory is successfully deleted; false otherwise
      

  2.   

    找到你的文件所在的路径,然后用delete()函数就可以了!