Java Program to Get the Last Access Time of a File
Every file which stores a lot of data, also has its own set of data ( known as metadata) which can be used to get the properties of that file. Such data types are called attributes. Java provides a basis for accessing any attributes of any file such as creation time of the file, last access time, last modified time, type of file, etc.
All this can be done by two important packages of java i.e.
The two main classes of this package which we will be using here are:
Example: readattributes() method of BasicFileAttributeView class will be used to get the attributes in the object of BasicFileAttributes class.
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.