This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin for Android App Development and have Peter Sommerhoff on-line!
See this thread for details.
Win a copy of Kotlin for Android App Development this week in the Kotlin 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
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Clarification in page 340,341 of the OCP Java SE 8 Programmer II Study Guide (Sybex)  RSS feed

 
Ranch Hand
Posts: 182
18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I saw in Javadocs that Future is a interface

But in the Sybex guide Page 340 3rd para last line, it says "when discussing the Future class", ...then class must be interface

I saw this again in Page 340 under Waiting for Results , in the para line it says "Future class includes methods".

and similarly in page 341 in the second paragraph after the code it says "As Future<V> is a generic class".

 
author
Posts: 4099
21
Eclipse IDE Flex Google Web Toolkit
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'll admit it, that ones mine! Since you never have to work with the specific implementation class of Future when studying concurrency for the OCP 8 exam, I got used to thinking of it as a class.

I love the factory pattern (where the specific return class type is "hidden" in favor of coding to an interface) but it has the side effect of you tend to think of an instances of an interface as belonging to a class with the same name.

Same thing happens when working with NIO.2, Path is an interface but it often is used like a class, since you are unlikely to ever work with the file system dependant class type. We did fix similar errors for Path, must have missed some for Future in Chapter 7!

If you call get() on a Future instance of our book, it shall be fixed
 
Ramya R Subramanian
Ranch Hand
Posts: 182
18
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Scott Selikoff wrote:If you call get() on a Future instance of our book, it shall be fixed


Sure. No problem
 
author & internet detective
Posts: 39129
723
Eclipse IDE Java VI Editor
 
A lot of people cry when they cut onions. The trick is not to form an emotional bond. This tiny ad told me:
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!