Question: what is the difference between polymorphism and inheritance though are used for reusability of code?
Answer: Inheritance refers to using the structure and behavior of a super class in a subclass. Polymorphism refers to changing the behavior of a super class in the subclass. Polymorphism: The ability to treat objects of different types in a similar manner.