d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Composition In Java
Add Reply New Topic New Poll
Member
Posts: 31,338
Joined: Mar 25 2009
Gold: 0.00
Dec 20 2018 01:43am
Anyone know of a good tutorial for this? The course i'm taking now isn't explaining it very well....
Preferably something that explains in depth and with clarity ty guys :)
Member
Posts: 4,032
Joined: Dec 4 2018
Gold: 56,369.16
Dec 25 2018 03:02am
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
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll