CS Electrical And Electronics
@cselectricalandelectronics

What is containership or nesting of classes in Cpp?

All QuestionsCategory: Cpp LanguageWhat is containership or nesting of classes in Cpp?
CS Electrical And Electronics Staff asked 4 years ago

I need short information.

1 Answers
CS Electrical And Electronics Staff answered 4 years ago

Nesting of classes in Cpp

  1. C++ supports another way of inheriting the properties of one class into another.
  2. 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.