- package cn;
- import java.io.File;
- public class Test4
- {
- public static void main(String[]args)
- {
- File file = new File("e:\\");
- show(file);
-
- }
- public static void show(File file)
- {
- File[] files = file.listFiles();
- if(files!=null)
- for(File f:files)
- {
- if(f.isFile())
- {
- System.out.println(f.getAbsolutePath());
- }
- else
- {
- show(f);
- }
- }
- }
- }
复制代码 |
-
4.png
(92.13 KB, 下载次数: 10)
看清楚
|