In this chapter you will learn:
- What is Polymorphism?
- Types of Polymorphism in c#
What is Polymorphism?
Polymorphism is one of the fundamental concept and strongest pillars of Object Oriented Programming. Simply Polymorphism means – One Interface, Multiple Functions. It is a Greek word that means Many Forms.
Types of Polymorphism
There are two types of Polymorphism in C#.
- Static Polymorphism or Compile Time Polymorphism (
Early Binding or Method Overloading)
- Dynamic Polymorphism or Runtime Polymorphism (
Late Binding or Method Overriding)
In static Polymorphism, you bind a function with an object during compile time. In simple word, you tag a function with an object while writing program. It is also called early binding. In static polymorphism, Function Overloading gets implemented.
It is also called as Late Binding or Method Overriding or Dynamic Polymorphism. In dynamic polymorphism, we override base class function using virtual & override keywords.
In the next chapter you will learn about Static Polymorphism or Function Overloading with complete programming example.