本帖最后由 莫言江城 于 2015-10-28 20:11 编辑
public class ZuoYe2 {
public static void main(String[] args) {
File file=new File("F:\\day19_code");
deleteFiles(file);
}
private static void deleteFiles(File file) {
File[] files=file.listFiles();
if(files!=null){
for(File f:files){
if(f.isDirectory()){
deleteFiles(f);
}else{
System.out.println(f.getAbsolutePath()+"**"+f.delete());
}
}
System.out.println(file.getAbsolutePath()+"**"+file.delete());
}
}
}
|
|