Question: what is the difference between inheritance and aggregation explain with example?
Answer: Inheritance: extend the functionality of a class by creating a subclass. Override superclass members in the subclasses to provide new functionality. ... Aggregation: create new functionality by taking other classes and combining them into a new class.