.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Articles >> OOPS >> Post New Resource Bookmark and Share   

 Subscribe to Articles

What is Polymorphism?

Posted By:Gurunatha Dogi       Posted Date: August 14, 2009    Points: 25    Category: OOPS    URL: http://www.dotnetspark.com  
 

Introduction

This article will discuss about Polymorphism in object oriented programming. Watch our 500 videos on Azure, WCF, WPF, LINQ, Design Patterns, WWF, Silverlight, UML @ http://www.questpond.com/

What is Polymorphism?

  • Polymorphism is one of the primary characteristics (concept) of object-oriented programming.
  • Poly means many and morph means form. Thus, polymorphism refers to being able to use many forms of a type without regard to the details.
  • Polymorphism is the characteristic of being able to assign a different meaning specifically, to allow an entity such as a variable, a function, or an object to have more than one form.
  • Polymorphism is the ability to process objects differently depending on their data types.
  • Polymorphism is the ability to redefine methods for derived classes.

Types of Polymorphism

  • Compile time Polymorphism
  • Run time Polymorphism

Compile time Polymorphism

  • Compile time Polymorphism also known as method overloading
  • Method overloading means having two or more methods with the same name but with different signatures

Example of Compile time polymorphism

 

 

Run time Polymorphism

  • Run time Polymorphism also known as method overriding
  • Method overriding means having two or more methods with the same name , same signature but with different implementation

Example of Run time Polymorphism

You can find source code at the bottom of this article.

 Subscribe to Articles

     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More Articles on C#, ASP.Net, Vb.Net, SQL Server and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend