Java Reference
In-Depth Information
9
Inheritance
CHAPTER OBJECTIVES
Explore the derivation of new classes from existing ones.
Define the concept and purpose of method overriding.
Discuss the design of class hierarchies.
Discuss the issue of visibility as it relates to inheritance.
Explore the ability to derive one interface from another.
Discuss object-oriented design in the context of inheritance.
Describe the inheritance structure for GUI components.
Explore the creation of listeners by extending adaptor classes.
T his chapter explains inheritance, a fundamental technique for
organizing and creating classes. It is a simple but powerful idea that
influences the way we design object-oriented software and enhances
our ability to reuse classes in other situations and programs. In this
chapter we explore the technique for creating subclasses and class
hierarchies, and we discuss a technique for overriding the definition
of an inherited method. We examine the protected modifier and dis-
cuss the effect all visibility modifiers have on inherited attributes and
methods. Finally, we discuss how inheritance affects various issues
related to graphical user interfaces (GUIs) in Java, such as the ability
to extend an adaptor class to create a listener.
443
 
 
Search WWH ::




Custom Search