---
title: "What is Polymorphism?"  
description: "What is Polymorphism?"  
author: "Shikhar Arora"  
published: 2019-11-07  
updated: 2019-11-07  
canonical: https://www.mindstick.com/forum/145452/what-is-polymorphism  
category: "c#"  
tags: ["c#", ".net", "oops", "programming language"]  
reading_time: 2 minutes  

---

# What is Polymorphism?

Why and When we should use Polymorphism.

## Replies

### Reply by Shikhar Arora

Polymorphism means same method playing different roles for different requirements at the same time. For example, Father plays a role of son for his father and at the same time he plays the role of father for his son.

```
namespace Polymorphism
{
    class Program
    {
        public void Bank()// Defining Bank function without any Parameters
        {
            Console.WriteLine("You have successfully opened an account");
        }
  //Defining Bank method with two Parameters
        public void Bank(int Credit, int Deposit)
        {
            int c = Credit;
            int d = Deposit;
            Console.WriteLine("Credit: " + c + " Deposit: " + d);
        }
  //Defining Bank method with return type and single parameter
        public string Bank(string Msg)
        {
            string msg = Msg;
            return msg;
        }
        static void Main(string[] args)
        {
            Program obj = new Program();//Instantiating Program class
  //Calling more than one method named Bank at the same time
            obj.Bank();
            obj.Bank(4500, 2200);
            Console.WriteLine(obj.Bank("Your account has been credited with Rs. 4500"));
            Console.ReadLine();
        }
    }
}
```


---

Original Source: https://www.mindstick.com/forum/145452/what-is-polymorphism

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
