In How many ways, I can achieve polymorphism in c#?
How many ways, I can achieve polymorphism in c#?
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
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
Pankaj Kumar ChoudharyRank #80 · 24.4K reputationPosted Mar 20, 2015, 6:47 AM EDT
1.Static
Static Poly can be achieved by Function overloading,Operator Overloading
2. Dynamic Poly.
Dynamic Poly can be achieved by Virtual method ,abstract class ,Interface
Keertti Raj Thangavelu BabuRank #3,979 · 374 reputationPosted Mar 20, 2015, 3:12 AM EDT
Polymorphism is when a class can be used as more than one type through inheritance. It can be used as its own type, any base types, or any interface type if it implements interfaces.
It can be achieved in the following ways:
Derived class inherits from a base class and it gains all the methods, fields, properties and events of the base class.
To completely take over a class member from a base class, the base class has to declare that member as virtual.
Abrar Ahmad AnsariRank #3,390 · 425 reputationPosted Mar 20, 2015, 3:14 AM EDT
1:static-->function overloading.
2:dynamic: function overriding,abstract class and interface.