Java 实例 - 获取目录最后修改时间

Java 教程 · 2019-02-11 07:28:48

以下实例演示了使用 File 类的 file.lastModified() 方法来获取目录的最后修改时间:

Main.java 文件

import java.io.File; import java.util.Date; public class Main { public static void main(String[] args) { File file = new File("C://FileIO//demo.txt"); System.out.println("最后修改时间:" + new Date(file.lastModified())); } }

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

最后修改时间:Fri Apr 10 11:09:19 CST 2015

点击查看所有 Java 教程 文章: https://www.codercto.com/courses/l/12.html

查看所有标签

Introduction to the Design and Analysis of Algorithms

Introduction to the Design and Analysis of Algorithms

Anany Levitin / Addison Wesley / 2006-2-24 / USD 122.00

Based on a Based on a new classification of algorithm design techniques and a clear delineation of analysis methods, "Introduction to the Design and Analysis of Algorithms" presents the subject in a c......一起来看看 《Introduction to the Design and Analysis of Algorithms》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具