Start of Tutorial > Start of Trail > Start of Lesson |
Search
Feedback Form |
To create a package, you put a class or an interface in it. To put a class or an interface into a package, you put apackage
statement as the first statement in the source file for the class or the interface. The path name of the source and class file of a class or an interface mirrors the name of the package.To use a class or an interface that's in a different package, you have three choices:
- Use the fully qualified name of the class or the interface.
- Import the class or the interface.
- Import the entire package of which the class or the interface is a member.
You might have to set your class path so that the compiler and the interpreter can find the source and class files for your classes and interfaces.
Start of Tutorial > Start of Trail > Start of Lesson |
Search
Feedback Form |
Copyright 1995-2004 Sun Microsystems, Inc. All rights reserved.