Difference between inheritance and aggregation? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Difference between inheritance and aggregation?

26th Feb 2017, 7:18 AM
subham saurabh
subham saurabh - avatar
2 Answers
+ 1
inheritance "is a" of something. so like a manager and a custodian "is a" employees. -- I know thats not proper english but I gets the point across aggregation "is made of" or "is a part of" so like a laptop "is made of" screen keyboard - is made of keys battery etc. so inheritance allows the children classes to take stuff or need to use stuff from the patent class. aggregation uses other objects to make another object. hope this helps!
26th Feb 2017, 5:09 PM
Michael Szczepanski
Michael Szczepanski - avatar
0
can u make it more clear()
15th Mar 2020, 12:51 PM
gopi
gopi - avatar