Monday, April 30, 2012

What is Polymorphism? How does VB.NET/C# achieve polymorphism?

Polymorphism: It's derived from a Greek word, where poly means many morph means Faces/Behaviors.
Same function/operator will show different behaviours when passed different types of values or different number of values.
Types of polymorphism:There are 2 types:-
1. Static polymorphism/Early Binding/Compile time polymorphism.
2. Dynamic polymorphism/Late Binding/Run time polymorphism.

Static polymorphism is achieved using i) Function overloading ii) Operator overloading

Dynamic polymorphism is achieved using i) Function overloading

2 comments: