Java Reference
In-Depth Information
5
Inheritance, Interfaces, and
Polymorphism
In This Chapter
Inheritance and Object-Oriented Design
Inheritance and Objects
Inheriting Methods
Redefining a Method
Extending a Method
Why Inheritance?
Inheritance, Objects, and COBOL
More COBOL Object-Oriented Design Patterns
Inheritance and Java
Hiding Variables and Methods
The this Variable
Java Interfaces
Using Interfaces
Hiding Methods and Members
Polymorphism
Exercises
Reviewing the Samples
This chapter really begins to get into object-oriented concepts. Understanding these
concepts is critical to becoming a sound Java programmer.
I NHERITANCE AND O BJECT -O RIENTED D ESIGN
An important benefit of object-oriented (OO) languages like Java is their ability
to use the concept of inheritance . This technique allows a class to be created that
extends another class in some fashion. The new class might enhance or specialize
101
Search WWH ::




Custom Search