---
title: "Differentiate between overloading and overriding."  
description: "Differentiate between overloading and overriding."  
author: "Ravi Vishwakarma"  
published: 2021-08-23  
updated: 2021-08-23  
canonical: https://www.mindstick.com/forum/156705/differentiate-between-overloading-and-overriding  
category: "c#"  
tags: ["c#", "java", "c++"]  
reading_time: 2 minutes  

---

# Differentiate between overloading and overriding.

Differentiate between [overloading and overriding](https://www.mindstick.com/forum/34503/overloading-and-overriding).

## Replies

### Reply by Ashutosh Kumar Verma

## Difference between Overloading and overriding-

| **Overloading** | **Overriding** |
| --- | --- |
| In case of method overloading there are two or more methods with same name in single class. | In Overriding all methods have also same name but in different classes. |
| There are different parameters passes in all same name methods. | There are same parameter passes in all methods. |
| In method overloading we can call all methods by a single instance of a class | Here all methods can call with different class instance. |
| It is call automatically suitable methods by passing argument. | In method overriding all parameters are same so we need to call them with different class instance. |
| Here all parameters are different in sequence, in types or in number of parameters. | Here all parameters are same in sequence ,in types and in number of parameters. |
| ``` class Demo { public void Test(string name) { Console.WriteLine('Your name is'+name); } public void Test(int age) { Console.WriteLine('your age is'+age); } public void Test(string name, int age) { Console.WriteLine('your name is '+name+' and your age is '+age); } } class OverloadingExp { static void Main(string[] arg) { Demo demo = new Demo(); demo.Test('Ashutosh \n'); demo.Test(24+'\n'); demo.Test('Ashutosh',24); } } ``` | ``` public class Examp { public void Task(string name, int id) { Console.WriteLine('Name:{0}',name +' Id: '+ id); } } public class Exp { public void Task(string name, int id) { Console.WriteLine('Name:{0}',name + 'Id: '+id); } } public class Mark { public void Task(string name, int id) { Console.WriteLine('Name:{0}',name + 'Id: '+ id); } } class OverridigExp { static void Main(string[] arg) { Examp exe = new Examp(); exe.Task('Examp',001); Exp exp = new Exp(); exp.Task('Exp ' ,002); Mark mark = new Mark(); mark.Task('Mark ', 003); } } ``` |

\


---

Original Source: https://www.mindstick.com/forum/156705/differentiate-between-overloading-and-overriding

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
