---
title: "Method Overloading in C#"  
description: "Method overloading is a feature which allows a class to have two or more methods having same name but different signature means (multiple behavior but"  
author: "Anonymous User"  
published: 2016-05-05  
updated: 2018-03-27  
canonical: https://www.mindstick.com/articles/12033/method-overloading-in-c-sharp  
category: "c#"  
tags: ["c#", "oops"]  
reading_time: 2 minutes  

---

# Method Overloading in C#

[Method overloading](https://www.mindstick.com/articles/82/method-overloading) is a feature which allows a class to have two or more methods having same name but different signature means (multiple behavior but different signature). The process of creating more than one method in a class with same name or creating a method in [derived class](https://answers.mindstick.com/qa/30686/what-is-a-base-class-and-derived-class) with same name as a method in [base class](https://www.mindstick.com/blog/116/base-class-initilization) is [called as](https://www.mindstick.com/forum/471/why-is-white-box-testing-called-as-glass-box-testing) method overloading.\

Most of the [programming languages](https://yourviews.mindstick.com/story/1911/7-programming-languages-you-can-learn-for-seo) supports a technique called default/optional parameters. It allows to programmer to make one or several [parameter](https://www.mindstick.com/blog/450/parameter-class-in-c-sharp) optional, by giving them a [default value](https://www.mindstick.com/forum/23023/default-value-when-using-singleordefault).

**For example****:** Create a class ‘MethodOverloading'. Here notice one thing, method are same but signature are different.

**[Source Code](https://www.mindstick.com/forum/23271/is-there-a-way-to-get-the-source-code-from-an-apk-file):**

**MethodOverloading class**

```
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks; namespace OopsConcepts{    class MethodOverLoading    {         public int Addition(int a, int b)        {            int x;            return x = a + b;        }        public int Addition(int a, int b, int c)        {            int y;            return y = a + b + c;                                 }        public float Addition(float a, float b)        {            float u;            return u = a + b;        }        public float Addition(float a, float b, float c)        {            float v;            return v = a + b + c;        }    }}
```

**OverloadingTest class**\

```
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks; namespace OopsConcepts{    class OverLoadingTest                                                  {        static void Main(string[]args)        {             // Method Overloading Test            MethodOverLoading mol = new MethodOverLoading();            Console.WriteLine("Addition of {0}", mol.Addition(25, 25));            Console.WriteLine("Addition of {0}", mol.Addition(2.5f, 2.5f));            Console.ReadLine();        }    }}
```

---

Original Source: https://www.mindstick.com/articles/12033/method-overloading-in-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
