Object-Oriented Programming (OOP)
In computer science, Composition over inheritance refers to which of the following?
- A. A design guideline suggesting that building complex behavior by combining objects is often preferable to relying solely on class inheritance. ✓
- B. A variable defined in a class for which each object of that class maintains its own separate copy.
- C. A mechanism where the method to be executed is determined at compile time based on the object's declared type.
- D. A keyword used in a subclass to refer to members or methods of its immediate parent class.
Correct answer
A. A design guideline suggesting that building complex behavior by combining objects is often preferable to relying solely on class inheritance.
Explanation
Composition over inheritance refers to a design guideline suggesting that building complex behavior by combining objects is often preferable to relying solely on class inheritance.