About Question enthuware.ocpjp.v8.2.1570 :

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
eddie3
Posts: 14
Joined: Sat Dec 17, 2016 10:17 pm
Contact:

About Question enthuware.ocpjp.v8.2.1570 :

Post 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?

eddie3
Posts: 14
Joined: Sat Dec 17, 2016 10:17 pm
Contact:

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

Post by eddie3 »

Is this question going to get answered?

admin
Site Admin
Posts: 10065
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post 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.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 107 guests