01-11-2012, 03:27 PM
Packages, Inner Classes,& event handlers
Packages, Inner.ppt (Size: 43 KB / Downloads: 22)
What are Packages?
Packages are libraries of classes
These libraries are useful
Common operations and objects
Debugged
Provides Organization
Using a library is relatively simple
Creating it is (only slightly?) more difficult
Problems?
With all the import statements, how does Java know which class you mean when two classes have the same name?
It may not
You may need to fully qualify class names
When we import a class, are we in the package for visibility considerations?
No
Problem with Event Adapters
We often want our event handlers
(perhaps implemented as external adapter classes)
to have access to our class's methods and instance data.
But we don't want to share these methods and instance data with other classes or objects
What is a programmer to do?