Page 1 of 1

About Question enthuware.ocpjp.v8.2.1570 :

Posted: Fri Feb 24, 2017 6:26 pm
by eddie3
In the explanation of the question, in one place it reads:
Path getName(int index)
The index parameter is the index of the name element to return... The element that is farthest from the root has index count -1.

In another place it reads:
If you pass a negative index (to Path.getName( ))... java.lang.IllegalArgumentException is thrown.

Don't these two explanations contradict each other?

Re: About Question enthuware.ocpjp.v8.2.1570 :

Posted: Sun Feb 26, 2017 12:25 pm
by eddie3
Is this question going to get answered?

Re: About Question enthuware.ocpjp.v8.2.1570 :

Posted: Sun Feb 26, 2017 10:15 pm
by admin
There is no contradiction. Please read it carefully. It says, "count -1" not just -1. e.g. if the total number of elements in a path is 10, then the index of the farthest element from root is 10 - 1 i.e. 9.