Definition of Polymorphism in C++ with example.
The basic definition of polymorphism in C++ is
Polymorphism is the property by which the message can be sent to objects of several different classes , and each can respond to it in a different way depending upon its class. In C++ Polymorphism is itemplemend through the basic concept called as overloading.
Example of polymorphism
float a ( float b)
{
return b*b;
}
float a ( float b, float c)
{
return b*c;
}
No comments:
Post a Comment