Win a copy of High Performance Python for Data Analytics this week in the Python 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • 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: 71760
312
  • 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: 71760
312
  • 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: 40393
821
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.
 
Did Steve tell you that? Fuh - Steve. Just look at this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic