Page 1 of 1

About Question enthuware.ocpjp.v11.2.3308 :

Posted: Thu Apr 29, 2021 4:50 am
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

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

Posted: Thu Apr 29, 2021 8:09 am
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!

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

Posted: Wed May 05, 2021 5:16 am
by nojpi1
but question is "What will the following code NEVER print when run?" option 4 and 5 should be correct

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

Posted: Wed May 05, 2021 6:03 am
by admin
Oh right! :oops:
My bad. Reverted it back.

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

Posted: Fri May 14, 2021 8:50 am
by rosmarci
But it not fixed again?

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

Posted: Fri May 14, 2021 11:02 am
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.