File file = new File("文件夹路径"); File[] tempList = file.listFiles();for (int i = 0; i < tempList.length; i++) {System.out.println(tempList[i].getName());}