google407ec42f1ae5ff0e.html
top of page

WHAT IS POLYMORPHISM

Polymorphism or the ability to appear in many forms, is one of the vital primary

characteristic concepts of OOP. 'Poly, means many and morph means form in reference to OOP, it is an ability of assigning different meanings to entities such as variable, methods objects so that these can be made to exhibit more than one form. It provides the programmers with the flexibility of processing any object of differently depending upon their data type. Using this concept, a programmer can redefine various method of the classes derived form their base classes. Objects of different types can receive the same message and respond in different ways provided these objects have the same method definition(i.e. interface). The calling object, also sometimes known as the client, not know what type of object it is calling, the only thing that it needs to know or ensure is that the called object has is method of a specific name with defined arguments. Polymorphism is more often than not applied to derived classes, where the method of the parent class are replaced with those having different behaviors. It is the concepts like inheritance and polymorphism together make OOP flexible and easy to extend.











6 views0 comments

Recent Posts

See All

Comments


bottom of page