Thats not polymorphism at all; it's just function overloading.
class A
{
public:
virtual int foo ( ) { return 10; }
};
class B : public A
{
public:
virtual int foo() { return 20; }
};
// This is polymorphism, base class pointer pointing to derived class
A* b = new B()...