About Question enthuware.ocpjp.ii.v11.2.3322 :

All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.

Moderators: Site Manager, fjwalraven

Post Reply
BinSlayer
Posts: 10
Joined: Tue Jul 09, 2019 8:33 am
Contact:

About Question enthuware.ocpjp.ii.v11.2.3322 :

Post by BinSlayer »

Hi
The last option should work. At least it should work semantically.
Yes, after trying to execute the code I did notice that a parenthesis was missing ) . But after you fix the parenthesis it just outputs the same as the first 2 choices.
But I believe we can't possible be expected to look for parenthesis in the OCP exam, right? Am I wrong to believe so?
See what I mean below:

Code that works:

Code: Select all

Set<String> newBooks = books
            .stream()
            .collect(Collectors.filtering(p, Collectors.mapping(Book::getTitle, Collectors.toSet())));
Code in Enthuware last option that is wrong:

Code: Select all

Set<String> newBooks = books
            .stream()
            .collect(Collectors.filtering(p, Collectors.mapping(Book::getTitle, Collectors.toSet()));

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

Re: About Question enthuware.ocpjp.ii.v11.2.3322 :

Post by admin »

No, you are absolutely correct. Parenthesis is not the criteria here. The last option should also be correct. Fixed.
thank you for your feedback!
Paul.
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