In How many ways, I can achieve polymorphism in c#?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Pankaj Kumar ChoudharyPosted Mar 20, 2015, 10:47 AM
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
Abrar Ahmad AnsariPosted Mar 20, 2015, 7:14 AM
1:static-->function overloading.
2:dynamic: function overriding,abstract class and interface.
Keertti Raj Thangavelu BabuPosted Mar 20, 2015, 7:12 AM
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.