• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Sybex - OCP 11 Programmer I - Chapter 11 page 474 possible errata

 
Saloon Keeper
Posts: 1277
38
Eclipse IDE Postgres Database C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is super-minor, but in the brief introduction to provides and uses given on page 474 of the OCP 815 book, the examples omit ;'s at the end of the statements:

Jeanne and Scott wrote:To use it, you supply the API and class name that implements the API:
provides zoo.staff.ZooApi with zoo.staff.zooImpl

The uses keyword specifies that a module is relying on a service.  To code it, you supply the API you want to call:
uses zoo.staff.ZooApi



Please note that I and others use languages where ;'s are required at the end of all lines except the ones they are not required at the end of, so it had me wondering here.
In the examples for opens and all of the examples for requires you do show the full line terminating in a ;

I guess I will need to get my tail on over to Chapter 6 of the 816 book to find out if this was a typo or not.  The suspense is killing me...
 
Jesse Silverman
Saloon Keeper
Posts: 1277
38
Eclipse IDE Postgres Database C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Additionally, the brief introduction to the opens directive gets the syntax right, but describes it wrongly in English:

Here are two examples:
opens zoo.animal.talks.schedule;
opens zoo.animal.talks.media to zoo.staff;


The first example allows any module using this one to use reflection.
The second example only gives that privilege to the zoo.staff package.



Like exports, access is opened from packages but to modules in module-info.java syntax:
(from JLS):
opens PackageName [to ModuleName {, ModuleName}] ;

I'm arguably being even more picky here because it happens that in this case the zoo.staff module consists of solely the one zoo.staff package, but I found the package/module dichotomy a little tricky to remember when first reading this chapter so every bit helps.
 
author & internet detective
Posts: 40747
827
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 both. Thanks.
 
I am Arthur, King of the Britons. And this is a tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic