About Question enthuware.ocpjp.v11.2.3642 :
Moderators: Site Manager, fjwalraven
-
- Posts: 6
- Joined: Tue Jan 26, 2021 9:24 am
- Contact:
About Question enthuware.ocpjp.v11.2.3642 :
I think the code should be `Integer comparisonCode = 1;` for option 3 to not change the meaning of the code.
-
- Site Admin
- Posts: 10384
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v11.2.3642 :
You are right. Fixed.
thank you for your feedback!
thank you for your feedback!
-
- Posts: 8
- Joined: Sat Aug 27, 2016 2:51 pm
- Contact:
Re: About Question enthuware.ocpjp.v11.2.3642 :
Hello,
I think the code should make usage of comparisonCode instead of .filter(a->a == 0) ?
For example:
So in this way we can answer that we can replace a -> comparisonCode.equals(a) with method reference comparisonCode::equals
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();
-
- Site Admin
- Posts: 10384
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v11.2.3642 :
Yes, that would be better.
thank you for your feedback!
thank you for your feedback!
Who is online
Users browsing this forum: No registered users and 9 guests