获取文件或目录的最后修改时间
/* nowjava.com - 时 代 Java 提 供 */ import java.io.*; import java.util.Date; public class Main { public static void main(String[] args) { //create file object File file = new File("C://Folder//demo.txt"); long lastModified = file.lastModified(); System.out.println("File was last modifed at : " + new Date(lastModified)); } }/*来 自 n o w j a v a . c o m*/