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);
}

posted @ 2017-01-10 16:59  N神3  阅读(170)  评论(0编辑  收藏  举报