Posts

Showing posts from April, 2023

Method Overloading And Method Overriding In C#

Polymorphism means “Many Forms”. In polymorphism, poly means “Many,” and morph means “Forms.” polymorphism is one of the main pillars in Object Oriented Programming. It allows you to create multiple methods with the same name but different signatures in the same class. The same name methods can also be in derived classes. There are two types of polymorphism, Method Overloading Method Overriding In this article, I will explain the method overloading and method overriding concept in C#. Furthermore, I will try to demonstrate step-by-step differences between these. Method Overloading Method Overloading is a type of polymorphism. It has several names like “Compile Time Polymorphism” or “Static Polymorphism,” and sometimes it is called “Early Binding”. Method Overloading means creating multiple methods in a class with the same names but different signatures (Parameters). It permits a class, struct, or interface to declare multiple methods with the same name with unique signatures. The compi...