Java Files  «Prev  Next»


Files, Directories, and Paths in Java - Quiz

Each question is worth one point. Select the best answer or answers for each question.
 
1. Which one of the following filenames is least likely to cause cross-platform compatibility problems?
Please select the best answer.
  A. list_of_compatibility_issues_for_software_projects.doc
  B. list:compatibility_issues
  C. compatibility_issues
  D. compatibility issues list

2. The class name FileViewer2$EncodingListener.class will cause problems if you try to use it on a Macintosh. Why?
Please select the best answer.
  A. Dollar signs are not permitted in Macintosh filenames
  B. Macintosh filenames cannot have extensions
  C. The class name exceeds the maximum number of characters allowed for Macintosh filenames
  D. The .class extension is reserved for Macintosh system use

3. If you ran a Java application from the MS-DOS command prompt in which the current directory was C:\java\demo, then a relative path of ..\src\HelloWorld.java would refer to an absolute path of . .
Please select the best answer.
  A. C:\java\demo\src\HelloWorld.java
  B. C:\src\HelloWorld.java
  C. C:\java\HelloWorld.java
  D. C:\java\src\HelloWorld.java

4. What's the maximum number of characters you should use in the name of a Java class?
Please select the best answer.
  A. 26
  B. 27
  C. 32
  D. 223


5. The two parts of a Macintosh file are
Please select the best answer.
  A. the information fork and the system fork
  B. the data bucket and the system bucket
  C. the data fork and the resource fork
  D. the information bucket and the resource bucket


6. What is one way that a file is different from a stream?
Please select the best answer.
  A. It is possible for a program to jump around in a stream, reading first one part of a stream, then another. This isn't possible with a file.
  B. It is possible for a program to jump around in a file, reading first one part of a file, then another. This isn't possible with a stream.
  C. There is no difference. A file is a type of stream and can be treated in the same way as a stream.
  D. None of the above.

7. How many characters can Win32 filenames contain?
Please select the best answer.
  A. 255
  B. 8
  C. 32
  D. 65,535

Your score is 0.0