• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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: 42003
911
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: 42003
911
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).
 
Message for you sir! I think it is a tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic