Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

What is Difference between inheritance and polymorphism

Difference between inheritance and polymorphism in simple way that can understand easily.

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

1. Inheritance:

Inheritance is one in which a new class is created that inherits the properties of the already exist class. It supports the concept of code reusability and reduces the length of the code in object-oriented programming.

Inheritance is one in which a new class is created (derived class) that inherits the features from the already existing class(Base class).

It is basically applied to classes.

Inheritance supports the concept of reusability and reduces code length in object-oriented programming.

2. Polymorphism:

Polymorphism is that in which we can perform a task in multiple forms or ways. It is applied to the functions or methods. Polymorphism allows the object to decide which form of the function to implement at compile-time as well as run-time.

Whereas polymorphism is that which can be defined in multiple forms.

Whereas it is basically applied to functions or methods.

Polymorphism allows the object to decide which form of the function to implement at compile-time (overloading) as well as run-time (overriding).

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading