• 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
  • paul wheaton
  • Tim Cooke
  • Paul Clapham
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Jeanne Boyarsky
Saloon Keepers:
  • Roland Mueller
  • Tim Holloway
  • 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
 
I'm not dead! I feel happy! I'd like to go for a walk! I'll even read a tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic