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?
About Question enthuware.ocpjp.v8.2.1570 :
Moderator: admin
-
- Posts: 14
- Joined: Sat Dec 17, 2016 10:17 pm
- Contact:
-
- Posts: 14
- Joined: Sat Dec 17, 2016 10:17 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1570 :
Is this question going to get answered?
-
- Site Admin
- Posts: 10043
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1570 :
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.
If you like our products and services, please help us by posting your review here.
Who is online
Users browsing this forum: Google [Bot] and 21 guests