本帖最后由 javaeea 于 2015-9-30 19:29 编辑
private static void printLevel1(File file,int level) {
// TODO Auto-generated method stub
File file1 = new File("");
File[] fis = file.listFiles();
for(File file2:fis){
if(file2.isDirectory()){
printLevel1(file2,level+1);
}
for(int i=0;i<level;i++){
System.out.println("\\n");
}
System.out.println(file2.getName());
}
} |
|