一个关于迭代的问题(显示文件夹下的目录和文件)
package lesson13;import java.io.File;
public class Delete {
public void delete(File file) {
if (file.isFile() )
{
System.out.println(file.getName());
}
else
{
System.out.println(file.getName());
File[] st = file.listFiles();
for (File list : st)
{
System.out.print("\t");
delete(list);
}
}
}
public static void main(String[] args) {
Delete de = new Delete();
File file = new File("f:/test");
de.delete(file);
}
}
--------------------编程问答-------------------- http://topic.csdn.net/u/20111112/13/3621cdab-5026-402f-8437-e08a801a798f.html
补充:Java , J2ME