public static void main(String[] args) {
// TODO Auto-generated method stub
String path = "D:\\EA7.5\\";
File file = new File(path);
System.out.printf("文件\t\t\t\t大小\t类型\t修改日期\t","");
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
String[] flist = file.list();
for(String s:flist){
File file1 = new File(path+s);
System.out.println(file1.getName()+file1.length()+"\t"+(file1.isDirectory()?"文件夹":"文件")+"\t"+sdf.format(new Date(file1.lastModified())));
}
}
排版没排好,表示不知道怎么排,只做笔记用