exam questions

Exam 1z0-809 All Questions

View all questions & answers for the 1z0-809 exam

Exam 1z0-809 topic 1 question 23 discussion

Actual exam question from Oracle's 1z0-809
Question #: 23
Topic #: 1
[All 1z0-809 Questions]

Assuming that the file /data/december/log.txt does not exist and given the code fragment:

What is the result?

  • A. A file with the name log.txt is created in the /data directory and the content of the /data/december/log.txt file is copied to it.
  • B. The program executes successfully and does NOT change the file system.
  • C. A FileNotFoundException is thrown at run time.
  • D. A NoSuchFileException is thrown at run time.
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
maslac
Highly Voted 3 years, 4 months ago
D is correct. Path java.nio.file.Files.copy(Path source, Path target, CopyOption... options) throws IOException NoSuchFileException - thrown when source file does not exist FileAlreadyExistsException - thrown when target file already exist
upvoted 8 times
...
iSnover
Most Recent 5 months, 2 weeks ago
Selected Answer: D
D is correct. Path java.nio.file.Files.copy(Path source, Path target, CopyOption... options) throws IOException NoSuchFileException - thrown when source file does not exist FileAlreadyExistsException - thrown when target file already exist
upvoted 1 times
...
r1muka5
1 year, 5 months ago
Correct answer is D.
upvoted 1 times
...
karta
1 year, 11 months ago
Assuming that the file /data/december/log.txt does not exist so answer is D
upvoted 1 times
...
JME_CHG
3 years, 4 months ago
D, tested
upvoted 4 times
...
Peacock
3 years, 8 months ago
A FileAlreadyExistsException is thrown at run time
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago