Question OOP-INH-0031
EasyWhich of these is a 'has-a' relationship, better modelled by composition?
- A.
A car has an engine
- B.
A car is a vehicle
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Inheritance question
Which of these is a 'has-a' relationship, better modelled by composition?
A car has an engine
A car is a vehicle
Sign up free to see the answer and a step-by-step explanation.
A square is a shape
A dog is an animal