;

Thursday, 23 April 2015

Ploymorphism

Ploymorphism
the word Ploymorphism is a combination of two words poly and morphism. poly means
many and morphism means form. In object oriented programming Ploymorphism is the ability
of objects of different types of respond to functions of the same name. The user does not have to know the exact type of the object in advance. The behavior of the object
can be implemented by using virtual functions. A pointer can also refer to an object of a class. The member of an object can be accessed through pointers by using the symbols. The symbols
is known as member access operator. An array can store same types of data and an array of pointer is
also can be stored memory addresses of the object of same clases user to . It allows the user to
create a large number of objects in memory .

Pointers and inheritance
Pointers have very important capability of storing the addresses of different objects
A pointer can be store the address of object whose type is same as the type of pointer
. It can be be also store the address of any object that belongs to any child class of the class of pointer. Suppose there are three classes A,B and also C.The class A is a parent class wheres B and C
are child classes. A pointer of class A can store the addresses all objects of A as well as B and C.

The Type of pointer does not change when a pointer of parent class refers to an object
of child class. That is why, the pointer always execute the member functions of parent class
even if refers to a child object in the memory.

Virtual Functions
It means existing effects but not in realty. A type of function is that appears to exist in some part
of a program but does not exist really is called Virtual function. It Also used to important
functions.

Early Binding
 The assignment of types to variables and expression at compilition time is known as
Early binding. It is also called static binding. The early binding occurs
when everything required to call a function is known at compile time. Early binding enables the computer know exactly witch function will be called when a certain statement is executed.

When a program is compiled, the compiler checks the functions calls and decides which function is
to be executed. This process takes place during compilation process in normal programs with functions.




Share this post to

FacebookTwitterGoogle BuzzStumnleuponDeliciousDiggTechnorati

Comments From Facebook
Subscribe Us

Get free daily email updates!

Follow us!

1 comment: