java常用API
public static void main(String[] args) throws IOException {
File file = new File("d:/myfolder"); //myfolder文件夹
FileFilter filter = new FileFilter() {
@Override
public boolean accept(File pathname) {
return pathname.isFile();
}
};
File[] files = file.listFiles(filter);
System.out.println(files.length);
}
感谢您的阅读,您的支持是我写博客动力。