package com.hui_Demo3;
import java.io.File;
public class Test {
public static void main(String[] args) {
File file = new File("F:\\day14");
File[] listFiles = file.listFiles();
for (File file2 : listFiles) {
System.out.println(file2);
}
print_ja(file);
}
private static void print_ja(File file) {
// TODO Auto-generated method stub
File[] listFiles = file.listFiles();
for (File file2 : listFiles) {
if(file2.isFile()){
String absolutePath = file.getAbsolutePath();
if(absolutePath.endsWith(".java")){
System.out.println(absolutePath);
}
}else{
print_ja(file2);
}
}
}
} |
|