In the heart of object-oriented programming are classes and the objects created from classes. The initialization of the objects occurs in constructors while the modification of the state of an object is carried through methods. The packaging of these constructors and methods is the focus of data encapsulation. The fundamentals of classes, constructors, methods, and data encapsulation are addressed in this chapter.
We start with an introduction to classes including a discussion of how objects are managed in memory. Common aspects of constructors and methods are then presented including the concept of a signature, the passing of arguments, and the uses of the
The usage of constructors is ...