logo

Question detail

Which design principle recommends using composition instead of inheritance where appropriate?

Try the question, check the answer, then read the explanation to understand the curriculum point.

At a glance

MCQ

Type

practice

Style

Topic

Programming paradigms

Exam-style question

Try this first

Which design principle recommends using composition instead of inheritance where appropriate?.

  1. A.Encapsulate what varies
  2. B.Favour composition over inheritance
  3. C.Program to interfaces, not implementation
  4. D.Make every attribute public

Model answer

What a good answer should say

  • Favour composition over inheritance

Explanation

Why this works

The specification lists favour composition over inheritance as an object-oriented design principle.

Common mistake

No common mistake is linked to this question yet.

Related flashcards

No flashcards are published for this page yet.

Related practice questions

No questions are published for this page yet.