Dir Modification
# Java Example - Get Directory Last Modified Time
[ Java Examples](#)
The following example demonstrates using the `file.lastModified()` method of the `File` class to get the last modified time of a directory:
## Main.java File
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("Last Modified:" + new Date(file.lastModified())); }}
The output of the above code is:
Last Modified:Fri Apr 10 11:09:19 CST 2015
[ Java Examples](#)
YouTip