+ 1

How can the inheritance and polymorphism can be different?

Simple analogy can be helpful

1st Aug 2017, 1:25 PM
Sai Yerni Akhil
Sai Yerni Akhil - avatar
1 Odpowiedź
+ 1
Inheritance allows code to be reused and 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.
2nd Aug 2017, 12:56 AM
Corey
Corey - avatar