What is Run Time Polymorphism?

What is Run Time Polymorphism?


Posted in : Java Posted on : February 19, 2014 at 3:57 PM Comments : [ 0 ]

Polymorphism refers to classifying data types for object oriented programming. Run Time Polymorphism is one type of classifying method. Here we explain the terms in detail.

Run Time Polymorphism is a term corresponding to programming languages like Java and C++. To understand the term in its significance in programming language one must have a clear idea of what Polymorphism is and then different types of Polymorphism like Compile Time Polymorphism, Balanced Polymorphism and Run Time Polymorphism. The prefix 'poly' refers to many or multiple and 'morphism' refers to appearing or forms. Hence, Polymorphism means appearing in multiple or different forms. It is actually a term that is widely used in objected oriented computer programming. The ability of the programming language in processing objects in multiple ways depending on their class or type of data is termed as Polymorphism. Run Time Polymorphism is a type of this broader process of classifying data. Let us now obtain the definition and understanding concerning the term in detail.

Different types of Polymorphism

We have already seen that in object oriented programming the processing of objects in different ways as per the classification or type of the data is called Polymorphism. In nutshell it refers to the ability to redefine methods according to classification of data or data types. For instance if the programmer is given a base class such as 'Shape' he can further define different area methods for different classes or data types like rectangles, circles, squares and so on. Polymorphism thus is the key principle to define various classes or types of data in object oriented programming. Now this principle of defining data types or classes can be separated into different types and sub types depending upon how the classes and data types are written in programming language.

Run Time Polymorphism vs. Compile Time Polymorphism

By the term Run Time Polymorphism we refer to having implementations of multiple sub types for a super type. The method is the super type and subtypes only implements that method.

On the other hand method overloading is the Compile Time Polymorphism. While we continue to have multiple implementations of sub types for a super type the compiler plays the role of determinant as to determine which type is to be invoked at the compile time.

Go to Topic «PreviousHomeNext»

Your Comment:


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

 
Tutorial Topics