• 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

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: 4342
40
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: 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
Noted in the errata. Thanks.
 
Everyone is a villain in someone else's story. Especially this devious 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