Oracle
1Z0-805 · Question #26
Given the code fragment: Path path1 = Paths.get("D:\\sales\\.\\quarterly\\..\\report"); path1 = path1.normalize(); Path path2 = path1.relativize(Paths.get("d:\\empdetails.dat")); path2 =…
Sign in or unlock 1Z0-805 to reveal the answer and full explanation for question #26. The question stem and answer options stay visible for context.
Java I/O Fundamentals
Question
Given the code fragment:
Path path1 = Paths.get("D:\sales\.\quarterly\..\report"); path1 = path1.normalize(); Path path2 = path1.relativize(Paths.get("d:\empdetails.dat")); path2 = path2.resolve(path1); System.out.println(path1); System.out.println(path2); } What is the result?
Options
- AD: \sales\report
- B\sales\report
- CD: \sales\quarterly\ . . . \report
- D\sales\report
- ED: \sales\quarterly\ . . .\report
- F\sales\report\empdetails.dat
- GD: \sales\report
- H\sales\report\empdetails.dat
Unlock 1Z0-805 to see the answer
You've previewed enough free 1Z0-805 questions. Unlock 1Z0-805 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.
Topics
#Path normalization#relativize#resolve#NIO.2