Java Reference
In-Depth Information
Final Thoughts on Packages and Interfaces
Although the examples we've included in this topic do not make frequent use of packages
or interfaces, both of these tools are an important part of the Java programming environ-
ment. Virtually all real programs that you write in Java will be contained within packages.
A number will probably implement interfaces as well. It is important, therefore, that you
be comfortable with their usage.
Chapter 8 Self Test
1
.
Using the code from
Try This 8-1
, put the
ICharQ
interface and its three implement-
ations into a package called
qpack
. Keeping the queue demonstration class
IQDemo
in the default package, show how to import and use the classes in
qpack
.
namespace?
fies it?
plement?
with other parts of a program?
11
.
A package is, in essence, a container for classes. True or False?