Lets say Michael Jackson and I are objects of same class HumanBeing. But he had a better implementation of the behaviour 'dance' than me .
How do I do this programatically , so that 2 objects of same class can have different implementation?
class HumanBeing
{
public :
HumanBeing(){};
void dance() { }
};
HumanBeing Me , MJ;
Me.dance(); ///bad dance
MJ.dance(); //good dance