Oracle Java SE 21 Developer Professional 1z0-830 Question # 13 Topic 2 Discussion

Oracle Java SE 21 Developer Professional 1z0-830 Question # 13 Topic 2 Discussion

1z0-830 Exam Topic 2 Question 13 Discussion:
Question #: 13
Topic #: 2

Given:

java

public class Test {

public static void main(String[] args) throws IOException {

Path p1 = Path.of("f1.txt");

Path p2 = Path.of("f2.txt");

Files.move(p1, p2);

Files.delete(p1);

}

}

In which case does the given program throw an exception?


A.

Neither files f1.txt nor f2.txt exist


B.

Both files f1.txt and f2.txt exist


C.

An exception is always thrown


D.

File f2.txt exists while file f1.txt doesn't


E.

File f1.txt exists while file f2.txt doesn't


Get Premium 1z0-830 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.