java count files in folder

Solutions on MaxInterview for java count files in folder by the best coders in the world

showing results for - "java count files in folder"
Benjamin
23 Mar 2020
1File directory=new File("directory path");
2    int fileCount=directory.list().length;
3    System.out.println("File Count:"+fileCount);