package com.day16.File;
import java.io.File;
import java.io.FilenameFilter;
public class FileSix {
public static void main(String[] args) {
File dir=new File("E:\");
String[] arr=dir.list(new FilenameFilter() {
@Override
public boolean accept(File dir, String name) {
File file=new File(dir, name);
return file.isFile() && file.getName().endsWith(".docx");
}
});
for(String str:arr) {
System.out.print(str+" ");//java虚拟机详解.docx 基于中心节点扩展的社区发现算法修改稿.docx 文中原图.docx
}
}
}