nerdexam
Oracle

1Z0-851 · Question #64

Given that the current directory is empty, and that the user has read and write privileges to the current directory, and the following: import java.io.*; public class Maker { public static void…

The correct answer is B. Nothing is added to the file system. See the full explanation below for the reasoning.

Question

Given that the current directory is empty, and that the user has read and write privileges to the current directory, and the following: import java.io.*; public class Maker { public static void main(String[] args) { File dir = new File("dir"); File f = new File(dir, "f"); } } Which statement is true?

Options

  • ACompilation fails.
  • BNothing is added to the file system.
  • COnly a new file is created on the file system.
  • DOnly a new directory is created on the file system.
  • EBoth a new file and a new directory are created on the file system.

How the community answered

(45 responses)
  • A
    4% (2)
  • B
    73% (33)
  • C
    13% (6)
  • D
    2% (1)
  • E
    7% (3)

Community Discussion

No community discussion yet for this question.

Full 1Z0-851 Practice