import java.io.*;
public class Del
{
public static void main(String[] args) 
{
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 
    Throws: 
    SecurityException - If a security manager exists and its SecurityManager.checkDelete(java.lang.String) method denies delete access to the file
      

  2.   

    楼主,zbsk(sophie)答得差不多了吧