• 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
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

OCP Java 8 SE Study Guide - Chapter 7- Concurrency (Sybex)

 
Ranch Hand
Posts: 53
1
Oracle Java
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

There is one typo in AmbiguousLambdaSample class example. The main method should throws IOException exception.

Thanks
 
author & internet detective
Posts: 41590
883
Eclipse IDE VI Editor Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good find. Thanks for noticing. I've added it to the errata list. It's on page 343 of the print book as a reference to non Safari readers.
 
Greenhorn
Posts: 12
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jeanne, hi Prateek,

I don't think "throws IOException" is necessary here, as none of the methods (useCallable, useSupplier and use) declare to throw an IOException. An IOException is thrown from the lambdas, but that doesn't matter.
 
Jeanne Boyarsky
author & internet detective
Posts: 41590
883
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
Philippe,
It's hard to say because there are two lines that are flagged as not compiling. So what would be needed if it were to compile is subject to debate. Which means in this case, if adding the exception makes it clearer, I'm fine with it. (I agree it isn't actually needed).
 
If you open the box, you will find Heisenberg strangling Shrodenger's cat. And waving this tiny ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic