Advertisements
Advertisements
Question
Define the following with an example each.
Polymorphism
Definition
Solution
Polymorphism is the process of using a function for more than one purpose. It allows the use of different internal structures of the object by keeping the same external interface.
Example: Assume you have a smartphone to communicate. Communication mode: You can choose anything. It can be a call, text, photo, email, etc. So the purpose is the same, i.e. communication, but the approach is different. This is called polymorphism.
shaalaa.com
Is there an error in this question or solution?
Chapter 1.01: Introduction to Object Oriented Programming Concepts - EXERCISES [Page 9]