Win a copy of Getting started with Java on the Raspberry Pi this week in the Raspberry Pi forum!
  • 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Liutauras Vilda
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Piet Souris

Java OCP 8 Programmer II StudyGuide: page 557 (Chapter 4 mock explanation) #12 errata?

 
Greenhorn
Posts: 3
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Correct answers should be A, F, G, and E. Consumer<String> can be assigned String::new.

Tested with JDK 1.8
 
Marshal
Posts: 78427
374
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch
Please explain more about the question; most of us don't have that book.
 
Mikhail Saltyshev
Greenhorn
Posts: 3
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:Welcome to the Ranch
Please explain more about the question; most of us don't have that book.

Screen-Shot-2021-01-10-at-16.42.33.png
[Thumbnail for Screen-Shot-2021-01-10-at-16.42.33.png]
Screen-Shot-2021-01-10-at-16.43.10.png
[Thumbnail for Screen-Shot-2021-01-10-at-16.43.10.png]
 
Campbell Ritchie
Marshal
Posts: 78427
374
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you simply ask which of those lines of code will compile,

Supplier<String> sup = String::new;

...will compile too. There must be more to it than that.
 
Mikhail Saltyshev
Greenhorn
Posts: 3
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:If you simply ask which of those lines of code will compile,

Supplier<String> sup = String::new;

...will compile too. There must be more to it than that.



What do you mean? The question is "Which functional interfaces complete the following code? (Choose all that apply)". The answer should be: A, F, G, as well as E, since Consumer<String> can also complete the first line.
 
author & internet detective
Posts: 41763
885
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
Added to an errata. Have a cow for being the first to notice after all this time!

Luckily, we did fix this in our Java 11 book.
 
reply
    Bookmark Topic Watch Topic
  • New Topic