Method Overloading

Several methods with the same name but different parameters.

What is Method Overloading?

Method overloading means having several methods with the same name but different parameters. The language picks the right one based on what you pass in.

public int Add(int a, int b) => a + b;
public double Add(double a, double b) => a + b;
public int Add(int a, int b, int c) => a + b + c;

Level: Apprentice · More OOP terms at this level

Updated

In other subjects