C++20 sections · 1024 units
Open in Course

Quiz: Inheritance Design

Knowledge check

Check Your Understanding

When should you prefer composition over inheritance?

  1. A.When you need polymorphic behavior
  2. B.When both classes need the same data members
  3. C.Never - inheritance is always better
  4. D.When the relationship is 'has-a' rather than 'is-a'
Start the roadmap to answer the quizzes and solve the challenges