Which type's method gets invoked at runtime is different from which type is being passed as the method argument.
Eventhough the horse class's method will be called at runtime, since the argument type is Mammal, it uses the method that takes Mammal argument which is present only in the base class. The following is a slightly modified version of the above code. I added another method that takes no argument. Hope this helps.
In lines 1 and 3, since there is no method argument and horse class does have a method with no argument, Horse class' method gets called.
One other way to
test this is to add a method eat(Mammal m) to the Horse class and see that getting called.