
C H A P T E R 9
Object-Oriented
Programs
9.1 INTRODUCTION
The first part of this chapter presents and explains the basic structure of
a cla ss. An introduction to data descriptions and the general structure of
methods is dis cussed. The construction of simple object-oriented programs is
presented.
The second part of this chapter discusses inheritance as a class relatio n-
ship among classes. The other basic class relationship is composition, which
is a str onger form of association. These relationships are easily modeled in
UML diagrams. Composition can be c onsidered a horizontal relationship and
inheritance a vertical relationship.
Inheritance is a facility ...