import java.nio.file.*;import java.nio.file.attribute.*;import java.io.IOException;public class PathDemo5{ public static void main(String[] args) { Path myPath = Paths.get("C:\\Java\\Input.Output\\MyData.txt"); try { ---------Code here ---------- System.out.println("Creation time " + attr.creationTime()); System.out.println("Last modified time " + attr.lastModifiedTime()); System.out.println("Size " + attr.size()); } catch(IOException e) { System.out.println("IO Exception"); } }}
Using the above code, create a statement on the indicated line that uses the readAttributes() method of the Files class that takes two arguments-the Path object created in the code and a BasicFileAttributes.class-and returns an instance of the BasicFileAttributes class named attr.
BasicFileAttributes attr = Files.readAttributes(myPath, BasicFileAttributes.class);
Computer Science & Information Technology
You might also like to view...
To emphasize text on a slide, you should use italics or underlining
Indicate whether the statement is true or false
Computer Science & Information Technology
Filtering data deletes the rows that do NOT meet the specified criteria
Indicate whether the statement is true or false.
Computer Science & Information Technology