- What is the importance of objects in C++?
Objects and classes are the building blocks of a C++ program. By combining data and algorithms (code) into a single unit, the C++ program represents the components of the system that it models, as well as their interactions.
- What relation is expressed by public inheritance?
Public inheritance represents an is-a relationship between objects—an object of the derived class can be used as if it was an object of the base class. This relation implies that the interface of the base class, with its invariants and restrictions, is also a valid interface for the derived class.
- What relation is expressed by private inheritance?
Unlike public inheritance, private inheritance says nothing about the interfaces. It expresses a has-a or is implemented in terms of relationship. The derived class reuses the implementation provided...