Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Sybex:Java 8 OCA/OCP Practice Tests Chapter 23 question 58 typo page 559

 
Ranch Hand
Posts: 215
11
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sybex: Java 8 OCA/OCP Practice Tests Chapter 23(OCP Practice Exam) question 58 typo in explanation page 414 explanation at page 559

58. C. The filter() method passes two of the three elements of the stream through to the terminal operation.
This is "redundant" since the terminal operation checks the same Predicate.

TYPO: It is NOT redundant because omitting "filter(pred)" gives false at allMatch.





by alinvlad05
 
Marshal
Posts: 28271
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Vlad Alin wrote:58. C. The filter() method passes two of the three elements of the stream through to the terminal operation.
This is "redundant" since the terminal operation checks the same Predicate.



Indeed, as that example shows: It's true that the two methods check the same Predicate, but they apply it to different elements of the Stream.
 
author & internet detective
Posts: 41944
911
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have two cows. This error was in all three of our practice exam books (Java 8, 11, and 17) and you were the first to notice. You are absolutely right!

I recorded it in all three errata pages crediting you.
 
We must storm this mad man's lab and destroy his villanous bomb! Are you with me tiny ad?
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic