Please tell me how Polymorphism helps in programming ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Please tell me how Polymorphism helps in programming ?

I am not able to understand where to use this Polymorphism concept

9th Aug 2020, 7:48 AM
Himanshu Chauhan
Himanshu Chauhan - avatar
2 Answers
+ 5
It allows methods that perform similar or closely related functions to be accessed through a common name. For example, a program performs operations on an array of numbers which can be int, float, or double type. Method overloading allows you to define three methods with the same name and different types of parameters to handle the array operations. more more info visit 👇 https://www.quora.com/What-are-the-advantages-of-polymorphism
9th Aug 2020, 7:57 AM
Arsenic
Arsenic - avatar
+ 2
It's not much! It means, having the same method name in the child class as well! It is not very special! If you overrride one method of the parent class the other methods of the parent class will not get affected! https://code.sololearn.com/c0XSMU2NzRbe/?ref=app
9th Aug 2020, 8:00 AM
Namit Jain
Namit Jain - avatar