public class Main { public static void main ( String [ ] args ) { File file = new File ( " Main.java " ) ; Long lastModified = file . lastModified ( ) ; Date date = new Date ( lastModified ) ; System . out . println ( date ) ;

以上代码运行输出结果为:

Thu Apr 09 09:40:19 CST 2015

Java 实例 Java 实例