• 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

A Possible typo in question 76 in chapter 6 (OCP 17 - Practice Tests)

 
Ranch Hand
Posts: 72
5
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello

With reference to question 76 in chapter 6 of the OCP Oracle Certified Professional Java SE 17 Developer Practice Tests: Exam 1Z0-829 (English Edition) book (Kindle edition), shown below.



Blankie is a record and thus has color() method and not getColor().

The answer seems to skip this part and only focus on the part that the return type is String instead of boolean.

C.  The filter() method takes a Predicate, which requires a boolean return type from the lambda or method reference.  The getColor() method returns a String and is not compatible.  This causes the code to not compile and option C to be the answer.


 
author & internet detective
Posts: 41933
910
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
Confirmed errata. In the Java 11 book, it wasn't a record and there was a getColor.
reply
    Bookmark Topic Watch Topic
  • New Topic