0
Why we use compositions in c++?
Here we uses classes constructors methods. we can use this directly without saying or showing it like a composition.
1 Answer
+ 1
ObjectĀ CompositionĀ is useful in a C++ context becauseĀ itĀ allows us to create complex classes by combining simpler, more easily manageable parts. This reduces complexity, and allows us to write code faster and with less errors becauseĀ weĀ can reuse code that has already been written, tested, and verified as working.