博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
递归读取文件夹下的文件
阅读量:4672 次
发布时间:2019-06-09

本文共 378 字,大约阅读时间需要 1 分钟。

public class FileRecursive {public static void main(String[] args) {    File file=new File("D:/");    testFile(file);    }public static void testFile(File file){    if (file.isDirectory()) {        for (File f : file.listFiles()) {            testFile(f);        }    }else{        System.out.println(file.getName());    }}}

 

转载于:https://www.cnblogs.com/tonggc1668/p/7397440.html

你可能感兴趣的文章
待整理
查看>>
LINUX 循环fork()
查看>>
谈谈冒烟测试
查看>>
SQL SERVER将多行数据合并成一行(转载)
查看>>
我爱Java系列---【EL和JSTL】
查看>>
IDEA
查看>>
简单scrapy爬虫实例
查看>>
dosbox
查看>>
06day1
查看>>
COM 学习(五)——编译、注册、调用
查看>>
设计模式——责任连模式
查看>>
POJ 1716 Integer Intervals 差分约束
查看>>
在Android中通过导入静态数据库来提高应用第一次的启动速度
查看>>
对于SQL注入的理解
查看>>
Jenkins:项目配置
查看>>
查看windows所有exe的启动参数。
查看>>
发布几个PDF小工具
查看>>
git修改user.name 和user.email
查看>>
C# winFrom窗体设计问题-部分文件打不开窗体设计器 变成类.cs
查看>>
POJ 2136
查看>>