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 :
Moderators: Site Manager, fjwalraven
- 
				drdima2
 - Posts: 3
 - Joined: Thu Apr 29, 2021 4:45 am
 - Contact:
 
- 
				admin
 - Site Admin
 - Posts: 10443
 - 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!
- 
				nojpi1
 - 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
			
			
									
									
						- 
				admin
 - Site Admin
 - Posts: 10443
 - 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.
- 
				rosmarci
 - Posts: 2
 - Joined: Wed Mar 24, 2021 11:34 am
 - Contact:
 
Re: About Question enthuware.ocpjp.v11.2.3308 :
But it not fixed again?
			
			
									
									
						- 
				admin
 - Site Admin
 - Posts: 10443
 - 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.
Who is online
Users browsing this forum: No registered users and 34 guests