I noticed that (maybe it is file system dependent) having same thing on both sides doesn't result in adding /..
This seem obvious, but it couter intuitive that:
I learned in K & B that the objective is to get from readme.txt to index.html. Do that by counting upward the number of directories from readme.txt. Tell me if I'm wrong, but I'm assuming I stop at \personal\ because that is the directory both paths have in common, and I don't need to count back to the root. So I count up four directories," \\personal\\.\\photos\\..\\" including the single dot (.) which is not removed because we're not normalizing. That gives me ..\..\..\.., the fourth directory being \personal\. So I jump to the \personal\ of p2 and attach \index.html, and now I have ..\..\..\..\index.html. Right? Go up four directories, jump over to p2's \personal\ and attach index.html. And then I can double-check it using your technique.
Am I correct in assuming that in counting up the directory tree I don't need to go to the root c: which both paths have in common? I stop at the first directory they have in common, that being \personal\. And, am I correct in counting the first \\..\\ directory, and the \\.\\ (one dot current directory)?
While it's fine for OCP 8, this question is also present in OCP 11 Pt 2. That means the correct answer is the 3rd answer and not the 1st. Couldn't you guys update it in OCP 11?
You are right. We have gone through all questions involving relativize and have made sure they use the logic used by Java 11 in the OCP 11 Pt 2 question bank (version 1.12).
thank you for your feedback!
PS. We just sent you an email.
If you like our products and services, please help us by posting your review here.
I've just downloaded the Java 11 upgrade exam and came across this as well. Am I right in now assuming that the correct answer here should now be "..\\index.html" ? That's the answer I chose but it was marked incorrect, and still says the correct answer should be "..\..\..\..\index.html"
My version is v11.2.1584.
>java -version
java version "1.8.0_221"
Java(TM) SE Runtime Environment (build 1.8.0_221-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.221-b11, mixed mode)
As from the explanation "if both paths have a root component" it is dependent of the implementation if a relative path can be constructed. So, this question is a bit out of scope but as I understand it might be on the exam, anyway. Also, after reading through the comments, I suppose some implementation on the base of Java 8 will deliver wrong results if compiled with Java 11 now. But probably, that's normal. Thanks for your work!