close
The method list() in the File class can help you to achieve this purpose.
for example :
public static void main(String args[])
{
File dir = new File(directory);
String[] files = dir.list();
System.out.println(files.length);
}
全站熱搜