a. isDiskDirectory
b. isDirectory
c. isFileDirectory
d. isPath
15.3 Q7: Which of the following statements is false?
a. Path method isAbsolute returns a boolean indicating whether a Path represents an
absolute path to a file or directory.
b. Files static method getLastModifiedTime receives a Path and returns a
FileTime (package java.nio.file.attribute) indicating when the file was last
modified.
c. Files static method size receives a Path and returns a long representing the number
of bytes in the file or directory. For directories, the value returned is platform specific.
d. All of the above are true.
15.4 Sequential-Access Text Files
15.4.1 Creating a Sequential-Access Text File
15.4.1 Q1: Which statement regarding Java files is false?
a. Java imposes no structure on a file.
b. Notions like “record” do not exist in Java files.
c. The programmer must structure files to meet the requirements of applications.
d. Records in a Java sequential file are stored in order by record key.
15.4.1 Q2: When all the contents of a file are truncated, this means that ________.
a. the data in the file is saved to a backup file
b. the file is deleted
c. a FileNotFoundException occurs
d. all the data in the file is discarded
15.4.2 Reading Data from a Sequential-Access Text File
15.4.2 Q1: What does the following statement do?
Scanner scanner = new Scanner(Paths.get(“test.txt”));
a. Opens a binary file for input.
b. Opens a binary file for output.
c. Opens a text file for input.
d. Opens a text file for output.