Tuesday, April 10, 2007

What is Polymorphism/Late Binding?

When an object is sent a message then it does not know itself what type it is, the runtime environment will decide about function calling over an object. This feature of connecting an object with its associated message at runtime is known as Polymorphism or Late binding or Dynamic binding.

4 comments :

Nishanth Thomas ,Bangalore said...

The ability to take more than one form is called Polymorphism, sigle function may handle different objects.

HotBlogs on November 10, 2010 at 11:34 PM said...

Super-class's instance variable can point to objects of any of its sub-class's object at run-time. IE we can assign object of any sub-class to the instance variable of super-class at run-time. IE instance variable of a super-class can know where to point only at run-time and not at compile time. This is called Late Binding.

It can also be treated as Polymorphism, as same instance variable of super-class can point objects of different sub-classes [one at a time] thus having different forms.

Polymorphism means single name and many forms.

vino on June 20, 2011 at 7:14 PM said...

method overloading is the example for polymorphism.

Shyamla on November 10, 2011 at 3:32 AM said...

Single function have the ability to perform the different different task is called polymorphism (one name multiple forms).
Type of polymorphism
- compile time and
- run time polymorphism.
we can achieve compile time polymorphism through function overloading and run time polymorphism through function overriding.

 

Disclaimer
Interview Questions On Java,Java EE Copyright © 2017. Reads: best tracker