Big Halloween Sale Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: simple70

Oracle Java SE 11 Developer 1z0-819 Question # 6 Topic 1 Discussion

Oracle Java SE 11 Developer 1z0-819 Question # 6 Topic 1 Discussion

1z0-819 Exam Topic 1 Question 6 Discussion:
Question #: 6
Topic #: 1

Given the code fragment:

Path currentFile = Paths.get(“/scratch/exam/temp.txt”);

Path outputFile = Paths get(“/scratch/exam/new.txt”);

Path directory = Paths.get(“/scratch/”);

Files.copy(currentFile, outputFile);

Files.copy(outputFile, directory);

Files.delete (outputFile);

The /scratch/exam/temp.txt file exists. The /scratch/exam/new.txt and /scratch/new.txt files do not exist.

What is the result?


A.

/scratch/exam/new.txt and /scratch/new.txt are deleted.


B.

The program throws a FileaAlreadyExistsException.


C.

The program throws a NoSuchFileException.


D.

A copy of /scratch/exam/new.txt exists in the /scratch directory and /scratch/exam/new.txt is deleted.


Get Premium 1z0-819 Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.