Question: The following code snippet results in an exception at runtime. Which of the following is the most likely type of exception to be thrown? A.
The following code snippet results in an exception at runtime. Which of the following is the most likely type of exception to be thrown?

A. AtomicMoveNotSupportedException
B. DirectoryNotEmptyException
C. FileAlreadyExistsException
D. The code does not compile.
E. None of the above.
var oldHardDrivePath = Path.get("c://rodent/mouse.txt"); var newHardDrivePath = Path.get ("d://rodent/rat.txt"); Files.move(oldHardDrivePath, newHardDrivePath, StandardCopyOption.REPLACE_EXISTING);
Step by Step Solution
3.40 Rating (150 Votes )
There are 3 Steps involved in it
The given code snippet is attempting to move a file from an old path to a new path and replace the file at the destination if it already exists It use... View full answer
Get step-by-step solutions from verified subject matter experts
