This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 21 Developer (Exam 1Z0-830) Java SE 17 Developer (Exam 1Z0-829) Programmer’s Guide and have Khalid Mughal and Vasily Strelnikov on-line!
See this thread for details.
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

regarding observability

 
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Which compilation units are observable is determined by the host system. However, all the compilation units of the package java and its subpackages lang and io must always be observable. The observability of a compilation unit influences the observability of its package (��7.4.3).
7.4.3 Observability of a Package
A package is observable if and only if either:
A compilation unit containing a declaration of the package is observable.
A subpackage of the package is observable.
One can conclude from the rule above and from the requirements on observable compilation units, that the packages java, java.lang, and java.io are always observable.
7.4.4 Scope of a Package Declaration
The scope of the declaration of an observable (��7.4.3) top level package is all observable compilation units (��7.3). The declaration of a package that is not observable is never in scope. Subpackage declarations are never in scope.
It follows that the package java is always in scope (��6.3).
Package declarations never shadow other declarations.


The above quote is from jls 7.3; my problem is that no defination of "observable" as for complilation units are given in jls,and the "observable" as for package. what functionality they serve to the language? and how could i determine which compilation units are observable given a particular host system?
i also dont quite understand the implication of the "scope" of a package, how i regard "Subpackage declarations are never in scope."?
 
Ranch Hand
Posts: 3141
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi James,
See this earlier discussion on Observable packages
Hope it helps.
------------------
Jane Griscti
Sun Certified Programmer for the Java� 2 Platform
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic