55.9k views
15 votes
What is the difference between private inheritance and composition?

1 Answer

4 votes

Answer:

Step-by-step explanation:

Use composition when you can, private inheritance when you have to. Normally you don't want to have access to the internals of too many other classes, and private inheritance gives you some of this extra power

User Aleksei Chepovoi
by
5.4k points