🔞 ADULT: T//certification/Java OCP Programmer II StudyGuide - HD Photos!

  • 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:
  • Devaka Cooray
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
Bartenders:

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: 81697
593
  • 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: 81697
593
  • 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.