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.