What is containership or nesting of classes in Cpp?
1 Answers
Nesting of classes in Cpp
- C++ supports another way of inheriting the properties of one class into another.
- Here the class can contain objects of other classes as its members.
Example:
class alpha {Â Â }
class beta {Â Â }
class gamma
{
alpha a;
beta b;
……
};
This kind of relationship is called containership or nesting.