// Using Directories.Import java.io.file; class dirlist {public static void main (string "args) {string strDirName =" c: / winnt "; file f1 = new file (strDirciRName); if (f1.Isdirectory ()) {System.out.println ("Directory of" strDirName; string s [] = f1.list ();
For (int i = 0; i