What are the importance of polymorphism? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

What are the importance of polymorphism?

Just I want to learn the principal of Polymorphism.

2nd Mar 2019, 5:39 AM
Nasir❤
Nasir❤ - avatar
4 Answers
+ 19
There are two good reasons to learn the meaning of polymorphism. • First, using such a fancy word in casual conversation makes you sound intelligent.😉 • Second, polymorphism provides one of the most useful programming techniques of the object-oriented paradigm. ⇨ Polymorphism, which etymologically means "many forms," is the ability to treat an object of any subclass of a base class as if it were an object of the base class. A base class has, therefore, many forms: the base class itself, and any of its subclasses.
2nd Mar 2019, 8:57 AM
Danijel Ivanović
Danijel Ivanović - avatar
+ 6
Polymorphism is really just the point all programmers reach when they want to simplify the core of the program and want to get rid of huge lumps of logic. In old school languages, you start bundling the calls together and passing a type. This occurs around about the time the 3rd object is dumped into the mess that you need to refactor and tidy up your naming schema so you can find things and minimize the edits for global changes... OOP formalizes those mechanisms ( plus a bunch of other stuff) and allows you to abstract the complexities of how different types of data are handled away from how you want your program to work.
2nd Mar 2019, 9:23 AM
Nasir❤
Nasir❤ - avatar
+ 2
Read about polymorphism.
2nd Mar 2019, 5:50 AM
M_N
2nd Mar 2019, 8:18 AM
Tibor Santa
Tibor Santa - avatar