Method Overloading is one of the types of polymorphism. In the object-oriented programming paradigm, polymorphism often refers to the ability to present the same interface for different forms. Although the concept of polymorphism is similar in all the programming languages, its implementation differs from language to language.
Method overloading is sometimes called static polymorphism or Compile Time Polymorphism or Early Binding. It basically means creating multiple methods in the same class with the same name but with different signatures. Here, different signatures refer to the total number of parameters passed to the functions & type.
Programming Example
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Overloading {
- class Car {
- public void Speed(int speed) {
- Console.WriteLine("Int: " + speed);
- }
- public void Speed(long speed) {
- Console.WriteLine("long: " + speed);
- }
- public void Speed(float speed) {
- Console.WriteLine("float: " + speed);
- }
- public void Speed(double speed) {
- Console.WriteLine("double: " + speed);
- }
- }
- class Program {
- static void Main(string[] args) {
- Car c = new Car();
- c.Speed(100);
- c.Speed(200 L);
- c.Speed(212.2 f);
- c.Speed(313.33);
- }
- }
- }

Prasad KrishnaraoPosted Mar 20, 2018, 10:43 AM
Thanks for sharing
GUFRAN KARIMPosted Mar 14, 2018, 2:45 PM
where is the 2nd part?
Bhavesh JadavPosted Mar 12, 2018, 12:02 AM
It's helpful for interview, thanks to share.........