Saturday, December 15, 2012

Polymorphism

Polymorphisms is a generic term that means 'many shapes'. More precisely Polymorphisms means the ability to request that the same operations be performed by a wide range of different types of things.

WHY polymorphism:
1. it makes our code simple. (by giving polymorphic nature)
2. u don't have remember which methode to call.


Diffenrent type of polymorphism:
      1. Static Polymorphism (Early binding) [at compile time]
      2. Dynamic Polymorphism (Late binding) [at runtime]


Polymorphism:
    1.1 compile time polymorphism:
          1.1.1. operator overloading              
          1.1.2. funtion/methode overloading      
 

    1.2. runtime Polymorphism: 
           1.2.1 methode overriding

1. Pointer to classes

2. Array of pointer


3. This pointer


4. Virtual function


5. Abstract class and pure virtual function 1


6. Abstract class and pure virtual function 2


7. dynamic allocation and polymorphism

No comments:

Post a Comment