Java Readers and Writers  «Prev 

Java Files and Dialogs - Quiz

1. When does the getParent() method in the File class return null?
Please select the best answer.
  A. When the file is a directory
  B. When the file has no parent
  C. When the file is a shortcut, symbolic link, or alias
  D. Never. If there's a problem, getParent() throws an IOException
  E. When the getParent() method is overloaded.

2. To implement the FilenameFilter interface you must provide an implementation for which of the following methods?
Please select the best answer.
  A. filter()
  B. show()
  C. display()
  D. open()
  E. accept()

3. Java provides a means of accomplishing all of the actions listed below except one. Which action cannot be accomplished by using Java?
Please select the best answer.
  A. Create a new file
  B. Append data to an existing file
  C. Create a new directory
  D. Set file permissions atomically across all platforms with a single Java method
  E. Move a file to its parent directory