What is the real example of polymorphism?-tccicomputercoaching.com
- March 19, 2020
- Posted by: Riddhi Dhandha
- Category: C++ Programming Langauge at TCCI
Polymorphism means more than one form.
If we represent one thing in different form then it’s called Polymorphism.
The real example of Polymorphism:
Calculator is an example Polymorphism .If we want to do operations like addition, multiplication we can use two methods. It can take any type of arguments like Integer Addition or Double Addition etc and same applies for all other operations i.e the methods specified in your class Calculator. The whole point here is that a single method can take any type of arguments (Integer, Float, Double). Overriding is one way of polymorphism.
A man is Father at home for his children, Husband for his wife and an employee at office. This is also polymorphism. One person have more than one role in his life.
To learn more in detail about Object Oriented Concepts.
Join TCCI in Bopal and Satellite in Ahmedabad.
Call us @ 9825618292
Visit us @ http://tccicomputercoaching.com/