Java   View all facts   Glossary   Help
syntactic unit > scoping unit > package
Next scoping unitblock    Upscoping unit

package
subjectfact 
packagecan be importedadded by: DS, 2001-10-19 11:37:38.0
can be imported by using the import statement    source: Object Oriented Software Engineering by Lethbridge and Laganière, 2001-10-19 11:37:38.0
contains 0 or more classes and 0 or more interfacesadded by: JK, source: Sun Java Tutorial, 2001-10-19 11:37:38.0
defines a name space    source: Object Oriented Software Engineering by Lethbridge and Laganière, 2001-10-19 11:37:38.0
has definition A collection of related classes and interfaces that provides access protection and namespace managementadded by: JK, source: Sun Java Tutorial, reference: Tutorial, 2001-10-19 11:37:38.0
groups classes or interfaces by functionadded by: JK, source: Sun Java Tutorial, 2001-10-19 11:37:38.0
has a name2001-10-19 11:37:38.0
has purpose
  • to avoid naming conflicts
  • to control access
added by: JK, source: Sun Java Tutorial, 2001-10-19 11:37:38.0
has purpose to group together related classes into a subsystem    source: Object Oriented Software Engineering by Lethbridge and Laganière, 2001-10-19 11:37:38.0
is a subtopic of Packages2001-10-19 11:37:38.0
is specified by a file that begins with a package statementadded by: DS, 2001-10-19 11:37:38.0
is stored as a set of class files in a directoryadded by: DS, 2001-10-19 11:37:38.0
is a kind of scoping unit2001-10-19 11:37:38.0
see also package nameadded by: JK, 2001-10-19 11:37:38.0
to create you put a class in it or put an interface in it by putting a package statement at the top of the source file in which the class or interface is definedadded by: JK, source: Sun Java Tutorial, 2001-10-19 11:37:38.0
to import you use the import statement with the asterisk wildcard characteradded by: JK, source: Sun Java Tutorial, 2001-10-19 11:37:38.0
syntactic unithas syntax rule
bold = mandatory
italic = non-terminal
normal font = optional
2001-10-19 11:38:04.0

Kinds of package :

Next scoping unitblock    Upscoping unit