File List()列出文件目录

 
import java.io.File;


public class FileTest {

	public static void main(String[] args) {
		File myFile = new File("C:" + File.separator);
	    for(String s: myFile.list()){
	      System.out.println(s);
	    }
	}
	/**360Rec
360SANDBOX
AUTOEXEC.BAT
BOOT
boot.ini
bootfont.bin
desktop.ini
Documents and Settings
FavoriteVideo
grldr
huanjue2boot.bak
log.txt
menu.lst
mysql_script
NTDETECT.COM
ntldr
pagefile.sys
Program Files
RECYCLER
System Volume Information
Temp
WINDOWS
祖国您好窗口.history
	 * 
	 */
}

你可能感兴趣的:(list,String,File,Class,360,import)