About Question enthuware.ocpjp.v17.2.914 :

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

Moderator: admin

Post Reply
Dario_Castagnari
Posts: 2
Joined: Wed Mar 01, 2023 1:15 pm
Contact:

About Question enthuware.ocpjp.v17.2.914 :

Post by Dario_Castagnari »

Hi to everyone,

the question is "How many times is 2 printed out in the output?"

in my opinion the "2" is printed out three times, not one as checked as the correct answer.

This is the review:

This is a simple while loop nested inside a for loop. The for loop loops three times - once for each value in values array. Since, values.length is 3, x is incremented two times for each for loop iteration before the condition x<values.length returns false.
Therefore, it prints:
0 10
1 10
2 10
0 30
1 30
2 30
0 50
1 50
2 50

Maybe I misunderstand the question, who can help me understand why the option "3" is not correct?

Thank you in advance,

Dario

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

Re: About Question enthuware.ocpjp.v17.2.914 :

Post by admin »

I see that 3 is indeed set as the correct answer. Can you please post a screenshot of what you see?
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 35 guests