Question: what is the difference between inheritance and aggregation in java?
Answer: Inheritance: extend the functionality of a class by creating a subclass. ... Aggregation: create new functionality by taking other classes and combining them into a new class. Attach an common interface to this new class for interoperability with other code.