Win a copy of High Performance Python for Data Analytics this week in the 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
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

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

 
Ranch Hand
Posts: 182
18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 4235
33
jQuery Eclipse IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 40400
821
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
Noted in the errata. Thanks.
 
We must storm this mad man's lab and destroy his villanous bomb! Are you with me tiny ad?
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic