You want to know about polymorphism in C# along with its two types.
In general, polymorphism means possessing many forms. In C#, it means one interface, many functions. There are two types of polymorphism in C#. They are compile-time polymorphism and run-time polymorphism. Compile-time polymorphism is also referred to as static or early binding. Run-time polymorphism is also referred to as dynamic or late binding.
A practical example of compile-time or static polymorphism is the addition operator. When using the addition operator with numeric data, a mathematical operation occurs. When using the addition operator with string data, concatenation occurs. This example illustrates operator overloading. Method and operator overloading comprise compile-time polymorphism in C#. Abstract classes and virtual methods provide a means for run-time polymorphism. These topics are out of scope for this blog entry. But, the gist is that calls to methods with many implementations get determined at run-time. Let’s say you generate a random number in your code. You have two methods. One gets called when the number is even, and the other gets called when it’s odd. Determining which method gets called is an example of run-time polymorphism.