Q: How to search for files in a directory and subdirectories?
A: The following small program when executed like this:
should print a list of files in the current directoryCode:java FileList *
Code:// sample from Absolute Java FAQ public class FileList { public static void main(String args[]) { for (int i = 0;i < args.length; i++) { System.out.println("File " + i + ":" + args[i]); } if (args.length<=0) { System.out.println("No files!"); } } }