Essay
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 .
Correct Answer:

Verified
BasicFileAttributes ...View Answer
Unlock this answer now
Get Access to more Verified Answers free of charge
Correct Answer:
Verified
View Answer
Unlock this answer now
Get Access to more Verified Answers free of charge
Q21: You can use Java's _ class to
Q22: while(nextLine = reader.readLine() != null) <br> System.out.println(nextLine); <br>The
Q23: Briefly describe the Path class in Java.
Q24: Explain the difference between an absolute path
Q25: Match each term with the correct statement
Q27: Some text files are _ files that
Q28: Match each term with the correct statement
Q29: The benefit of using a(n) _ file
Q30: _ is an abstract class that contains
Q31: Because the backslash character starts the escape