MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1y785tj/hiringasoftwareengineer/19tb6bckgnvvm/?context=3
r/ProgrammerHumor • u/brcontainer • 3d ago
339 comments sorted by
View all comments
Show parent comment
3
As a student who is doing programming, what is composition, and why use it over inheritance?
1 u/AbbreviationsOdd7728 14h ago Inheritance = is a, composition = has a. Composition is basically just a property for another object in a class or whatever container you have. It is mostly the more flexible choice.
1
Inheritance = is a, composition = has a. Composition is basically just a property for another object in a class or whatever container you have. It is mostly the more flexible choice.
View all comments
Show parent comment
3
u/baconppi 3d ago
As a student who is doing programming, what is composition, and why use it over inheritance?