Profile photo for Nayan Bichpuriya

This is Inheritance (IS-A) vs. Composition (HAS-A) Relationship.

There are three classes Vehicle, Car and Engine and we just want to define relation of classes in language so we can say

Car is a Vehicle.

and

Car has a Engine.

View 7 other answers to this question
About · Careers · Privacy · Terms · Contact · Languages · Your Ad Choices · Press ·
© Quora, Inc. 2025