Win a copy of Hands On Software Engineering with Python this week in the Jython/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
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

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

 
Ranch Hand
Posts: 51
1
Java Oracle
  • Likes 2
  • Mark post as helpful
  • send pies
  • 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: 39054
714
Eclipse IDE Java VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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: 9
1
  • Mark post as helpful
  • send pies
  • 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: 39054
714
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • 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).
 
God is a comedian playing for an audience that is afraid to laugh - Voltair. tiny ad:
Programmatically Create PDF Using Free Spire.PDF with Java
https://coderanch.com/wiki/703735/Programmatically-Create-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!