File SetLastModified() Example
Sets the last-modified time of the file or directory named by this abstract pathname.
File class SetLastModified() method example. This example shows you how to use SetLastModified method.This method Sets the last-modified time of the file or directory named by this abstract pathname.
Here is the code:-
/**
* @Program that Sets the last-modified time of the file or directory named
* by this abstract pathname.
* SetLastModified.java
* Author:-RoseIndia Team
* Date:-30-May-2008
*/
import java.io.*;
import java.util.*;
public class SetLastModified {
public static void main(String[] args) {
File f = new File("/home/girish/Desktop/girish.txt");
boolean b=f.setLastModified(45);
System.out.println("Last Modified: "+b);
System.out.println(f.lastModified());
}
}
|
|