What is polymorphism-with-real-life-scenario-in-C-Sharp & can you give me real life scenario? I have faced this question during many interviews & seen many time on different forums, people are asking the same. But from very few places we are getting a perfect answer that is easy to understand. So as per my understanding & experience I would like to clear this topic through this article.
Polymorphism
Polymorphism word made with 2 words poly & morph where poly means “multiple” and morph means “forms” so polymorphism-with-real-life-scenario-in-C-Sharp means many forms. Polymorphism used to provide different functionality of methods with same name and different parameter in same class & with same name and same parameter in different class.
Basically there are 2 kind of polymorphism-with-real-life-scenario-in-C-Sharp:
- Overloading (Compile Time Polymorphism / Static Binding / Early Binding)
- Overriding (Runtime Time Polymorphism / Dynamic Binding / Late Binding)
Overloading
In overloading we are keeping two or more than two methods in same class with same name but different parameters. The parameter difference may be in term of no. of parameter or in term of type of parameter or order of parameter. Overloading also called Compile Time Polymorphism / Static Binding / Early Binding because here method execution occur at compile time.
Note: It doesn't depend on return type of method.
Real life scenario
So suppose you are working on a maintenance project. And you are working on a class where already parameterised constructors has defined & you need to pass some parameter. So what you will do, either add required parameter with one constructor or add new one as per your requirement. So you should not add the required parameter with one constructor because this may disturb your other class dependency structure. So what you will do create a new constructor with required parameter. That new constructor is nothing but constructor overloading. Overriding also called Runtime Time Polymorphism / Dynamic Binding / Late Binding because here method execution happen at run time.
Example:

Nilesh DhandePosted Jan 26, 2016, 10:01 PM
Good one
VikramPosted Oct 16, 2015, 5:05 AM
nice
Harshad PansuriyaPosted Sep 29, 2015, 5:07 AM
Nice One
Sujeet SumanPosted Sep 25, 2015, 1:32 AM
Thanks you so much to all of you................
Santhakumar MunuswamyPosted Sep 22, 2015, 3:14 PM
Nice Article. Thanks for sharing
Muhammad Aqib ShehzadPosted Sep 22, 2015, 7:18 AM
Nice Article...
Karthikeyan KPosted Sep 21, 2015, 11:43 PM
Good one sir...Thanks for sharing
Pankaj Kumar ChoudharyPosted Sep 21, 2015, 8:43 PM
Nice Explain Sir..........
RakeshPosted Sep 21, 2015, 10:21 AM
Good one
Ajeet MishraPosted Sep 21, 2015, 6:51 AM
nice
Ankit BansalPosted Sep 21, 2015, 6:15 AM
good one...
Surya Pratap SinghPosted Sep 21, 2015, 3:40 AM
Nice...
Sumit JoshiPosted Sep 21, 2015, 3:28 AM
Good one.
Vinodh NarayananPosted Sep 21, 2015, 3:25 AM
nice
Sibeesh VenuPosted Sep 21, 2015, 3:23 AM
Nice Share :)
Sujeet SumanPosted Sep 21, 2015, 2:33 AM
Thanks dear.......
Humayun Kabir MamunPosted Sep 21, 2015, 2:25 AM
Nice...