What is polymorphism
I dont understand what is polymorphism actually do?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Tamal MarickRank #4,584 · 336 reputationPosted Jul 9, 2019, 1:59 AM EDT
Sanwar RanwaRank #23 · 44.7K reputationPosted Jul 8, 2019, 8:27 PM EDT
Rajanikant HawaldarRank #110 · 20.2K reputationPosted Jul 8, 2019, 8:50 PM EDT
Jayanth ReddyRank #8,652 · 218 reputationPosted Jul 8, 2019, 9:09 PM EDT
Kapil GaurRank #390 · 6.4K reputationPosted Jul 8, 2019, 9:53 PM EDT
Ganesh SanapRank #3,772 · 392 reputationPosted Jul 8, 2019, 9:58 PM EDT
Somit Vishwakarma59 reputationPosted Jul 8, 2019, 10:09 PM EDT
Posted Jul 10, 2019, 7:25 PM EDT
Chittaranjan SwainRank #216 · 11.3K reputationPosted Jul 26, 2019, 2:19 AM EDT
Junaid ShahidRank #436 · 5.7K reputationPosted Jul 26, 2019, 2:34 AM EDT
Amit KumarRank #459 · 5.4K reputationPosted Jul 26, 2019, 10:41 PM EDT
Amit MohantyRank #112 · 20K reputationPosted Jul 8, 2019, 8:17 PM EDT
Harsh ShahRank #1,322 · 1.3K reputationPosted Aug 1, 2019, 7:17 PM EDT
In a programming language that exhibits polymorphism, objects of classes belonging to the same hierarchical tree (inherited from a common base class) may possess functions bearing the same name, but each having different behaviors.
As an example, assume there is a base class named Animals from which the subclasses Horse, Fish and Bird are derived. Also assume that the Animals class has a function named Move, which is inherited by all subclasses mentioned. With polymorphism, each subclass may have its own way of implementing the function. So, for example, when the Move function is called in an object of the Horse class, the function might respond by displaying trotting on the screen. On the other hand, when the same function is called in an object of the Fish class, swimming might be displayed on the screen. In the case of a Bird object, it may be flying.
Amit KumarRank #459 · 5.4K reputationPosted Aug 1, 2019, 7:46 PM EDT
Devesh Mehta95 reputationPosted Aug 1, 2019, 8:28 PM EDT
Sonu GuptaRank #1,261 · 1.4K reputationPosted Aug 5, 2019, 3:04 AM EDT
Mageshwaran RRank #411 · 6.1K reputationPosted Nov 21, 2019, 6:14 AM EST