package packageName;When a compilation unit has no package statement, the unit is placed in a default package, which has no name.
Code in one package can specify classes or interfaces from another package in one of two ways:
// prefacing with a packageacme.project.FooBar obj = new acme.project.FooBar();
// import all classes from acme.projectIt is illegal to specify an ambiguous class name and doing so always generates a compile-time error. Class names may be disambiguated through the use of a fully qualified class name, i.e., one that includes the name of the class's package.import acme.project.*;
means that every public class from acme.project is imported.
The following construct imports a single class, Employee_List, from the acme.project package:
// import Employee_List from acme.project
import acme.project.Employee_List;
Employee_List obj = new Employee_List();
The Java Language Specification
Generated with CERN WebMaker