Function overloading is compile time polymorphism and here the compiler decide which version of the method will called.For the compiler it's very difficult to know the actual object for run time so it check the reference type only irrespective of the object it's going to point.