Java Files get file last modified time

Description

Java Files get file last modified time


import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.attribute.FileTime;

public class Main {
  public static void main(String[] args) throws IOException {

    Path path = Paths.get("Main.java");
    FileTime b = Files.getLastModifiedTime(path);

    System.out.println(b);/*from w  w w .j  av  a 2  s. c  o  m*/
  }
}



PreviousNext

Related