Click here to Skip to main content
14,667,169 members
Rate this:
Please Sign up or sign in to vote.
See more:
The function overroding is certainly polymorphism. I wonder if function overloading is polymorphism too. I mean in function overloading we write multiple function with same name each with it's own functioning. The polymorphism have the similar concept. Please help me clearify.
Posted

Rate this:
Please Sign up or sign in to vote.

Solution 2

hi,
Good explanation provided here[^].

hope it helps !!
   
Rate this:
Please Sign up or sign in to vote.

Solution 1

No, these are separate concepts. In polymorphism one class of objects may be diversified by deriving subclasses that share part of the behavior of their base class and change or add some other behavior. That creates a tree-like hierarchy of classes.

In contrast, function overloading just uses the same function name for multiple functions with different argument sets. There is no inheritance involved and hence the set of functions with same name does not form a hierarchy.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100