Is-a vs Has-a

A quick test: "is-a" suggests inheritance, "has-a" suggests composition.

What is Is-a vs Has-a?

Is-a vs has-a is a quick test for picking inheritance or composition. A dog is an animal, so inheritance fits. A car has an engine, so composition fits.

Level: Journeyman · More OOP terms at this level

Updated