Given the code fragment:
Path path1 = Paths.get(“/app/./sys/”);
Path res1 = path1.resolve(“log”);
Path path2 = Paths.get(“/server/exe/”);
Path res1 = path1.resolve(“/readme/”);
System.out.println(res1);
System.out.println(res2);
What is the result?
A.
/app/sys/log
/readme/server/exe
B.
/app/log/sys
/server/exe/readme
C.
/app/./sys/log
/readme
D.
/app/./sys/log
/server/exe/readme
Answer is C.
But there are a few errata here.
The line next to “Path path2…” should be like this.
Path res2 = path2.resolve(“/readme/”);
I impl the question, the correct answer is C
Hello could you post the code please.
C.
/app/./sys/log
/readme
C
C. is correct
Correct answer is C, tested it and some errata must be corrected in the code above
Can someone explain why the answer is C and not D