This is a discussion on What are the different types of polymorphism? within the C and C++ Programming forums, part of the Software Development category; What are the different types of polymorphism?...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| 1. Types related by inheritance as polymorphic types because we can use many forms of a derived or base type interchangeably. 2. Only applies to ref or ptr to types related by inheritance. 3. Inheritance - lets us define classes that model relationships among types, sharing what is common and specializing only that which is inherently different. 4. Derived classes i. can use w/o change those operations that dont depend on the specifics of the derived type ii. Redefine those member functions that do depend on its type iii. Derived class may define additional members beyond those it inherits from its base class. 5. Dynamic Binding - lets us write programs that use objects of any type in an inheritance hierarchy w/o caring about the objects specific types. 6. Happens when a virtual function is called through a reference || ptr to a base class. 7. The fact that a reference or ptr might refer to either a base or derived class object is the key to dynamic binding. 8. Calls to virtual functions made though a reference/ptr resolved @ runtime. 9. The function that is called is the one defined by the actual type of the object to which ref/ptr refers.
__________________ J.Vijayanand |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Types of RAM | srikumar_l | Computer Hardware | 3 | 01-16-2008 04:26 AM |
| How many types of Actions are there in QTP? | devarajan.v | Software Testing | 1 | 10-30-2007 03:42 AM |
| Polymorphism | prasath | C and C++ Programming | 1 | 09-07-2007 08:28 AM |
| How many types of authentication modes are there and what are the Types.... | Archer | ASP and ASP.NET Programming | 1 | 07-25-2007 03:48 AM |
| Firewall Types | ragavraj | Server Management | 0 | 07-17-2007 09:55 AM |