About Question enthuware.ocpjp.v11.2.3642 :

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
peterz
Posts: 6
Joined: Tue Jan 26, 2021 9:24 am
Contact:

About Question enthuware.ocpjp.v11.2.3642 :

Post by peterz »

I think the code should be `Integer comparisonCode = 1;` for option 3 to not change the meaning of the code.

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

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

Post by admin »

You are right. Fixed.
thank you for your feedback!

soncrash
Posts: 8
Joined: Sat Aug 27, 2016 2:51 pm
Contact:

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

Post by soncrash »

Hello,

I think the code should make usage of comparisonCode instead of .filter(a->a == 0) ?

For example:

Code: Select all

        long l = courses.stream().peek(Course::printPassPercent)
                .map(c -> testCategory.compareToIgnoreCase(c.getCategory()))
                .filter(a -> comparisonCode.equals(a))
                .count();
So in this way we can answer that we can replace a -> comparisonCode.equals(a) with method reference comparisonCode::equals

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

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

Post by admin »

Yes, that would be better.
thank you for your feedback!

Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests