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);
You might also like to view...
Values of type ____ are represented using 16-bit integer numbers.
A. int B. boolean C. char D. long
Describe how packet-switching can increase the reliability of a network.
What will be an ideal response?
Why is it that DPCs cannot access pageable data?
What will be an ideal response?
What term does OSPF use to reference a router that has interfaces in more than one area?
A) ASBR B) Backbone C) Internal D) ABR