Umm, don't you have a decent book formally covering object oriented fundamentals? If you're interested in Java,
Bruce Eckel's Thinking in Java is highly acclaimed, and a free download to boot.
Anyhow, to expand on icecool83's explanation a bit, the important characteristic of polymorphism is that the correct behavior is automagically
performed at runtime.
In old procedural code, you'd have to do something like this pseudo-code:
function speak(Person thisPerson)
if (thisPerson.type is "Man")
Print "Hi I'm Mr. " thisPerson.lastName
else if (thisPerson.type is "Woman")
Print "Hi I'm Ms. " thisPerson.lastName
else if (thisPerson.type is "Baby")
Print "Ga-ga"
With polymorphism, you set up your class hierarchy as icecool83 suggested, override the speak() behavior in each derived class and the code is much simpler:
function greeting(Person thisPerson)
thisPerson.speak()
What happens is the runtime automatically determines the actual derived type of Person and then invokes the proper behavior for that type, whether it is Man, Woman or Baby. The important points of polymorphism are that you're working with a Person object (for which the actual type is not even visible) but the
runtime dynamically calls the correct behavior on the actual subtype. Hence, the Person type can take on "many forms".
This is one of the essential building blocks of object oriented programming, and it's extremely powerful. More so than it initially appears. Polymorphism is one of the keys to writing extensible software.
Finally, try to think in terms of classes and their objects (instances). Methods themselves aren't really polymorphic, but method
calls are. The reason your assignment differentiates by using the term "polymorphic function" is only because in C++, method calls are by default not polymorphic. They are polymorphic only if the methods are declared as
virtual. As suggested above, the mechanism behind polymorphism is
dynamic binding (aka dynamic dispatch or late binding).