import java.io.File;
import java.io.FilenameFilter;
public class GetHouzhuiming_1 {
public static void main(String[] args) {
File f=new File("g:\\java001\\day26");
String [] arr=f.list(new FilenameFilter() {
@Override
public boolean accept(File f, String name) {
// TODO Auto-generated method stub
return name.endsWith(".class");
}
});
System.out.println("length "+arr.length);
for(String name:arr){
System.out.println(name);
}
}
}
请问如何把找到,class文件直接删除掉?
|
|