| C++ Program Design, 3/e James P. Cohoon,
University of Virginia Jack W. Davidson,
University of Virginia
The class construct and object-oriented design
Chapter 7 OverviewObjects are the basic unit of programming in object-oriented languages like
C++. Objects are models of information and are implemented as software
packages that can encapsulate both attributes and behavior. The construct for
defining new types of encapsulated objects in C++ is the class. A class is the
“blueprint” from which an object can be created. In this chapter, we explain
how to create these blueprints, or specifications of objects. We do so by
showing the class declaration of a programmer-defined type that we used in
previous chapters—RectangleShape. |
|