Page 1 of 1

About Question enthuware.ocpjp.v11.2.3642 :

Posted: Wed Jan 27, 2021 5:28 am
by peterz
I think the code should be `Integer comparisonCode = 1;` for option 3 to not change the meaning of the code.

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

Posted: Wed Jan 27, 2021 6:37 am
by admin
You are right. Fixed.
thank you for your feedback!

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

Posted: Thu Mar 30, 2023 2:28 pm
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

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

Posted: Thu Mar 30, 2023 10:43 pm
by admin
Yes, that would be better.
thank you for your feedback!