About Question enthuware.ocpjp.v11.2.3642 :

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

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: 10036
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!
If you like our products and services, please help us by posting your review here.

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: 10036
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!
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 36 guests