Polymorphism is closely linked with inheritance, but it can also be used separately. Polymorphism can be defined as follows, and these definitions will be correct:
Abstraction and encapsulation are two poles of the same phenomenon. In the OOP approach, abstraction is the delineation of certain interfaces, consistent and complete, for fully working with a class…