what is mean by inheritance and polymorphism​
Answers
Inheritance allows, code reusability and the polymorphism is, the occurrence of one function with different form. The basic difference between inheritance and polymorphism is that inheritance allows the already existing code to be reused again in a program, and polymorphism provides a mechanism to dynamically decide what form of a function to be invoked.
Content: Inheritance Vs Polymorphism
Comparison Chart
Definition
Key Differences
Conclusion
Comparison Chart
BASIS FOR COMPARISON INHERITANCE POLYMORPHISM
Basic Inheritance is creating a new class using the properties of the already existing class. Polymorphism is basically a common interface for multiple form.
Implementation Inheritance is basically implemented on classes. Polymorphism is basically implemented on function/methods.
Use To support the concept of reusability in OOP and reduces the length of code. Allows object to decide which form of the function to be invoked when, at compile time(overloading) as well as run time(overriding).
Forms Inheritance may be a single inheritance, multiple inheritance, multilevel inheritance, hierarchical inheritance and hybrid inheritance. Polymorphism may be a compile time polymorphism (overloading) or run-time polymorphism (overriding).