---
title: "Method Overloading in C#"  
description: "In this article, I’m trying to explain the concept of method overloading.Method overloading is the concept of polymorphism which means one name multip"  
author: "Sumit Kesarwani"  
published: 2013-05-13  
updated: 2014-09-18  
canonical: https://www.mindstick.com/blog/503/method-overloading-in-c-sharp  
category: "c#"  
tags: ["c#"]  
reading_time: 2 minutes  

---

# Method Overloading in C#

In this [article](https://www.mindstick.com/articles/95867/are-you-looking-for-500-credit-score-mortgage-lenders-houston-continue-reading-this-article), I’m trying to [explain the concept](https://www.mindstick.com/forum/159605/explain-the-concept-of-unique-key-violation-error) of [method overloading](https://www.mindstick.com/articles/12033/method-overloading-in-c-sharp).Method overloading is the [concept of polymorphism](https://answers.mindstick.com/qa/111595/can-you-explain-the-concept-of-polymorphism-in-object-oriented-programming) which means one name [multiple](https://www.mindstick.com/blog/12797/iowa-is-expected-to-see-heavy-growth-in-multiple-sectors) forms. It defines that method can have same name with different [parameters](https://www.mindstick.com/articles/87/passing-parameters-in-c-sharp) or signatures. It allows you to have same name method in one class. In method overloading, method performs different tasks at the different input parameters.

Method overloading requires:

1 - Same [method name](https://www.mindstick.com/forum/33583/selector-creation-with-method-name-and-parameter).

2 - Number of parameters should be different.

3 - Types of parameters should be different.

To implement the method overloading, the [methods](https://www.mindstick.com/articles/13060/runny-nose-remedy-methods-that-work-best) must have same name and the numbers of parameters or data types of parameters must be different, having different return types of method does not make the method overloaded.

##### Example

```
using System;namespace MethodOverLoadingConsoleApplication{    class MethodOverloading    {        /// <summary>        /// mehtod area(int side) for calculating the area of square         /// </summary>        /// <param name="side">side of square</param>        public void area(int side)        {            int z = side * side;            Console.WriteLine("Area Of Square : "+z);        }        /// <summary>        /// mehtod area(int length,int width) for calculating the area of rectangle        /// </summary>        /// <param name="length">length of rectangle</param>        /// <param name="width">width of rectangle</param>        public void area(int length,int width)        {            int z = length * width;            Console.WriteLine("Area Of Rectangle : " + z);        }    }    class Program    {        static void Main(string[] args)        {            MethodOverloading mth = new MethodOverloading();//Create object             mth.area(4);            mth.area(7,5);        }    }}
```

##### Output :

Area Of Square : 16

Area Of Rectangle : 35

In this example, i have created two methods with the name area() - one for calculating the area of square and another for rectangle, note that both the methods have same name but different number of parameters which make the methods overloaded.

---

Original Source: https://www.mindstick.com/blog/503/method-overloading-in-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
