Hi again,
If two methods have different argument lists -- if the types differ
at all, even if, as in your case, one is a subclass of the other -- then there's no runtime
polymorphism. The method is said to be
overloaded, rather than overrridden. The compiler chooses which method to call based on the compile-time type of the arguments -- i.e., the types of any variables or literals passed to the method call.
It helps to think of a method as being characterized by a
signature, which includes the name of the method and the number and types of the arguments. If the signatures of two methods differ, they might as well have different names -- there is no polymorphism. You get runtime polymorphism only if the signatures are identical.
Note that I did not include the return type as part of the signature. As you've been asking about in another
thread, Java 5 allows covariant return types -- the return type of a method in a subclass can be a subtype of the return type of the method with the same signature in the parent class.