The Java program recursive algorithm lists all subdirectory and files in a directory.

xiaoxiao2021-03-06  107

The Java program recursive algorithm lists all subdirectories and files / * file names in a directory: DiGui.Java Description: Learn the rationter algorithm, list all subdirectories below a directory (including the directory below and Files) and files. The recursive function is that the function itself is directly or indirectly called in a function. Author: Chi Qin-Email: cqq1978@Gmail.comhttp: //blog.9cbs.net/cqq*/ import java.io. *; class DiGui {static void getDir (String strPath) throws Exception {try {File f = new File (StrPath); if (f.Indirectory ()) {file [] flist = f.listfiles (); for (int J = 0; j

Author Blog:

http://blog.9cbs.net/cqq/

转载请注明原文地址:https://www.9cbs.com/read-98073.html

New Post(0)