In the first scenario, the two methods have the
exact same signature. This creates an overridden method and, hence, the JVM uses dynamic binding to determine which method should be invoked at runtime.
In the second scenario, the two methods have
different signatures (one takes a double while the other takes an int) so we have what is known as method overloading (multiple methods with the same "name" but different signatures). In this case, the compiler can determine which method should be invoked at compile time.
Be sure to check out these sections of the JLS for more info:
§8.4.6 Inheritance, Overriding, and Hiding §8.4.7 Overloading I hope that helps,
Corey
[ June 23, 2003: Message edited by: Corey McGlone ]