Squelch interview question

Inheritance VS composition: pros and cons.

Interview Answer

Anonymous

21 Jan 2019

Inheritance should be used only if we can describe a relationship with a phrase like "X is a Y", like "student is a person". In all other cases composition/aggregation should be used.