All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.
1. "count" is the number of elements, so "starting from 0 or 1" is not a valid question here. If there are no elements then the count will be 0. It is the "index" that starts with 0. i.e. index of the first element is 0. If there are 10 elements, the index of the first element is 0 and last is 9.
2. The given path components are separated using the path separators and those components are counted. So, the question whether it includes root or not is not relevant here
3. Please read the explanation. It explains this output.
If you like our products and services, please help us by posting your review here.
Hi. Did they change the implementation in-between JDK 8 and JDK 11?
Indeed when running the code on JDK 11 it will print out 6 3 1 1.
It would seem to my naked eye that JDK 11 prefers normalizing any path before using it. Could you confirm that I got this right? Thanks.
Yes, it looks like they changed the implementation in Java 11.
The answer has been updated with relevant information.
thank you for your feedback!
Paul.
If you like our products and services, please help us by posting your review here.