IT Community - Software Programming, Web Development and Technical Support

What are the different types of polymorphism?

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?...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > C and C++ Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 07-23-2007, 01:16 AM
Sabari Sabari is offline
D-Web Genius
 
Join Date: Jul 2007
Posts: 1,008
Sabari is on a distinguished road
Exclamation What are the different types of polymorphism?

What are the different types of polymorphism?
__________________
Thanks & Regards
Sabari...
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-24-2007, 05:04 AM
vijayanand vijayanand is offline
D-Web Analyst
 
Join Date: Feb 2007
Posts: 293
vijayanand is on a distinguished road
Default Re: What are the different types of polymorphism?

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
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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


All times are GMT -7. The time now is 03:40 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0