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
About Question enthuware.ocpjp.v11.2.3308 :
Moderator: admin
-
- Posts: 3
- Joined: Thu Apr 29, 2021 4:45 am
- Contact:
Online
-
- Site Admin
- Posts: 10061
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v11.2.3308 :
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!
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.
-
- Posts: 1
- Joined: Wed May 05, 2021 5:08 am
- Contact:
Re: About Question enthuware.ocpjp.v11.2.3308 :
but question is "What will the following code NEVER print when run?" option 4 and 5 should be correct
Online
-
- Site Admin
- Posts: 10061
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v11.2.3308 :
Oh right!
My bad. Reverted it back.
My bad. Reverted it back.
If you like our products and services, please help us by posting your review here.
-
- Posts: 2
- Joined: Wed Mar 24, 2021 11:34 am
- Contact:
Re: About Question enthuware.ocpjp.v11.2.3308 :
But it not fixed again?
Online
-
- Site Admin
- Posts: 10061
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v11.2.3308 :
Where you are looking? I just checked the explanation and it is there.
Also, please update your question bank to v 1.53.
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.
Who is online
Users browsing this forum: No registered users and 104 guests