About Question enthuware.ocpjp.v11.2.3308 :

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

Moderator: admin

Post Reply
drdima2
Posts: 3
Joined: Thu Apr 29, 2021 4:45 am
Contact:

About Question enthuware.ocpjp.v11.2.3308 :

Post by drdima2 »

This question have a bug

enum SIZE
{
TALL, JUMBO, GRANDE;
}

class CoffeeMug
{

public static void main(String[] args)
{
var hs = new HashSet<SIZE>();
hs.add(SIZE.TALL); hs.add(SIZE.JUMBO); hs.add(SIZE.GRANDE);
hs.add(SIZE.TALL); hs.add(SIZE.TALL); hs.add(SIZE.JUMBO);
for(SIZE s : hs) System.out.print(s+" ");
}
}

This is set, should print all elements without duplicate.
Simulator give me a "right" answer that it should print this set with duplicate items.
I checked this code in compiler.
Compiler return me that it sholud print only not duplicate items.
Please fix

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

Re: About Question enthuware.ocpjp.v11.2.3308 :

Post by admin »

You are right. The given explanation is correct but two options have been set as correct by mistake.
Only option 3 should be set as the correct option. Fixed.
thank you for your feedback!
If you like our products and services, please help us by posting your review here.

nojpi1
Posts: 1
Joined: Wed May 05, 2021 5:08 am
Contact:

Re: About Question enthuware.ocpjp.v11.2.3308 :

Post by nojpi1 »

but question is "What will the following code NEVER print when run?" option 4 and 5 should be correct

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

Re: About Question enthuware.ocpjp.v11.2.3308 :

Post by admin »

Oh right! :oops:
My bad. Reverted it back.
If you like our products and services, please help us by posting your review here.

rosmarci
Posts: 1
Joined: Wed Mar 24, 2021 11:34 am
Contact:

Re: About Question enthuware.ocpjp.v11.2.3308 :

Post by rosmarci »

But it not fixed again?

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

Re: About Question enthuware.ocpjp.v11.2.3308 :

Post by admin »

Where you are looking? I just checked the explanation and it is there.
Also, please update your question bank to v 1.53.
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 1 guest