Win Prizes

Social Presence
Twitter Twitter LinkedIn YouTube Google

Like us on Facebook
Top Articles Author
Sat, 25-Apr-2015 Authors
All Time Authors

Latest members | More ...

(Statistics delayed by 5 minutes)

What is polymorphism?

Posted by under OOPS category on for Beginner level | Views : 31752 red flag
If you found plagiarised (copied) or inappropriate content,
please let us know the original source along with your correct email id (to communicate) for further action.
Rating: 4.67 out of 5
3 vote(s)
Generally, it is the ability to appear in different forms. In oops concept, it is the ability to process objects differently depending on their data types. Its the ability to redefine methods for derived classes.

There Are Two Types of Polymorphism

  1. Static Polymorphism
  2. Dynamic Polymorphism

1. Static Polymorphism
In Static Polymorphism ,Which method is to be called is decided at compile-time only. Method Overloading is an example of Static Polymorphism.

Method overloading is a concept where we use the same method name many times in the same class,but different parameters. Depending on the parameters we pass, it is decided at compile-time only, which method is to calles. The same method name with the same parameters is an error and it is a case of duplication of methods which c# does not permits. In Static Polymorphism decision is taken at compile time.

public Class StaticPolyDemo
  public void display(int x)
    Console.WriteLine(“Area of a Square:”+x*x);
  public void display(int x, int y)
    Console.WriteLine(“Area of a Square:”+x*y);
 public static void main(String args[])
    StaticPolyDemo spd=new StaticPolyDemo();

2. Dyanamic Polymorphism

In this Mechanism by which a call to an overridden function is resolved at a Run-Time( not at Compile-time). If a BaseClass contains method must be a Virtual method in C# to be overridden..

Class Test
  Public virtual void show()
  Console.WriteLine(“From base class show method”);
Public Class DynamicPolyDemo : Test
   Public  override void show()
         Console.WriteLine(“From Derived Class show method”);
   Public static void main(String args[])
       DynamicPolyDemo dpd=new DynamicPolyDemo();;

Page copy protected against web site content infringement by Copyscape
About the Author


Full Name: Syed Shakeer Hussiain P
Member Level:
Member Status: Member
Member Since: 2/5/2009 3:12:18 AM
Country: India
Syed Shakeer Hussain

Shakeer Hussain has completed his Master of Computer Applications degree from Deccan College of engg and technology of Osmania University.He is a MVM of has good experience in the areas of ASP.NET, C#.NET, VB.NET, SQL SERVER 2000/2005 and Windows Mobile. He has worked in Windows Mobile,Web Applicatin and ERP projects.
Login to vote for this post.
Share this to:

Bookmark It

Comments or Responses

Posted by: WebMaster on: 9/6/2009

For more details on this subject, kindly visit


Login to post response

Comment using Facebook(Author doesn't get notification)