The Java® Language Specification, Java SE 7 Edition, Fourth Edition
by James Gosling, Bill Joy, Guy Steele, Gilad Bracha, Alex Buckley
6.3. Scope of a Declaration
The scope of a declaration is the region of the program within which the entity declared by the declaration can be referred to using a simple name, provided it is visible (§6.4.1).
A declaration is said to be in scope at a particular point in a program if and only if the declaration’s scope includes that point.
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. The declaration of a subpackage is never in scope.
The package java is always in scope.
The scope of a type imported by a single-type-import declaration (§7.5.1) or a type-import-on-demand declaration (§7.5.2) is all the class ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access