About Question enthuware.ocpjp.v8.2.1711 :

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

Moderator: admin

Post Reply
admin
Site Admin
Posts: 10046
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post by admin »

Can you show a situation where the output contradicts the statement of option 3?
If you like our products and services, please help us by posting your review here.

Touciuciu
Posts: 11
Joined: Fri Aug 17, 2018 8:52 am
Contact:

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

Post by Touciuciu »

The answer should be "It may print any combination of the keys". Tested with STS and the output was "a,b,c". It is true that most of the time it will print c and maybe it will combine it with a or b but the question says that we should be able to determine the possible output so one possible output is a, b, c. Very rare but possible, this is why your answer is wrong. Please admit that is wrong and correct it.

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

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

Post by admin »

Yes, it can print "a, b, c". That is why option 3 is correct. Please read the option carefully. It says "except".
Option 1 cannot be correct because it will never print these four possibilities:
1. a,
2. b,
3. a, b,
4. b, a
If you like our products and services, please help us by posting your review here.

floryan
Posts: 17
Joined: Sun Sep 23, 2018 4:10 am
Contact:

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

Post by floryan »

Dhaval Dongre wrote:
Mon Apr 23, 2018 2:08 pm
I think the answer should be, "It may print any combination of the keys." In a real world scenario the selected answer sounds most reasonable. But thread execution in this case is unpredictable and in the rarest chance it is possible that the second thread runs first, prints everything and then the first thread runs. Thus the answer must be unpredictable.
Yes, this should be the correct answer. Especially because there's is such a huge focus on the unpredictability of thread execution in this exam.

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

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

Post by admin »

floryan wrote:
Thu Oct 04, 2018 3:16 pm
Dhaval Dongre wrote:
Mon Apr 23, 2018 2:08 pm
I think the answer should be, "It may print any combination of the keys." In a real world scenario the selected answer sounds most reasonable. But thread execution in this case is unpredictable and in the rarest chance it is possible that the second thread runs first, prints everything and then the first thread runs. Thus the answer must be unpredictable.
Yes, this should be the correct answer. Especially because there's is such a huge focus on the unpredictability of thread execution in this exam.
No, it should not be correct. As replied above, can you show a situation where the output contradicts the statement of option 3?
If you like our products and services, please help us by posting your review here.

floryan
Posts: 17
Joined: Sun Sep 23, 2018 4:10 am
Contact:

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

Post by floryan »

Ah okay, gotcha. Misleading but technically correct I guess. I didn't see the second page of the conversation here, sorry.

Mark7777
Posts: 32
Joined: Tue Apr 12, 2016 9:19 pm
Contact:

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

Post by Mark7777 »

So is the answer, "any combination as long as it contains a "c"? Something like that?

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

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

Post by admin »

Yes, you could say that.
If you like our products and services, please help us by posting your review here.

Touciuciu
Posts: 11
Joined: Fri Aug 17, 2018 8:52 am
Contact:

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

Post by Touciuciu »

Yes, the question is very confussing because you might think that:
-> Any combination of the keys can be printed (one of any combination is a, b, c which is possible)
-> Any combination, excluding .... (one of any combination is a, c or b, c)
-> The output cannot be determined

We understand the explanation but the question statement and answers are confussing and missleading. You can have a multiple choice option for this question

Bhaskar
Posts: 19
Joined: Fri Aug 02, 2019 7:04 am
Contact:

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

Post by Bhaskar »

admin wrote:
Fri Dec 16, 2016 1:17 am
The correct option does mention it. It says, "It may print any combination except: a, or b, or a, b, or b, a". This includes c a b and c b a.

HTH,
Paul.
'b, a' is a possible output because ConcurrentHashMap guarantees no order of elements right? i.e, [b,a,c] or [b,c,a] is a possible key entry in the Map.

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

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

Post by admin »

Correct.
If you like our products and services, please help us by posting your review here.

jost.boekemeier
Posts: 1
Joined: Fri Dec 30, 2022 1:58 pm
Contact:

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

Post by jost.boekemeier »

admin wrote:
Wed Aug 29, 2018 6:37 am
Yes, it can print "a, b, c". That is why option 3 is correct.
Well, if it can print a,b,c, then option 3 is certainly not correct, as its exclude list cannot be empty: "except: a, or b, or a, b, or b, a".

You could add "none" to the exclude list to fix this, but as it stands, option #1 is more correct than option #3.

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

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

Post by admin »

Yes, ideally, "none" could also be added to the exclude list.
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 60 guests