标签:for 文件 sp c r bs res file print
private static void tree(File f,int level){
String preStr = "";
for (int i = 0; i < level; i++) {
preStr+=" ";
}
File [] childs = f.listFiles();
for (int i = 0; i < childs.length; i++) {
System.out.println(preStr+childs[i].getName());
if(childs[i].isDirectory()){
tree(childs[i],++level);
}
}
}
标签:for 文件 sp c r bs res file print
原文地址:http://www.cnblogs.com/oraclespace/p/3983443.html