composition is a "Has A" relationship, so car class with engine object is a "Has A" relationship.
inheritance on the other hand is "Is A" relationship. E.g. animal superclass and cat subclass, where cat "is-a" animal, but not "has a" animal. so cat will always equal animal, but car will not equal engine.
This post was edited by Touta on Dec 25 2018 03:03am