I think Srini's answer is wrong. The method that has
String as the parameter is invoked because
String is more specific (
String is a subclass of
Object). If you modify the second method, change the paramater type to
Integer,
it will print "in Integer".
For more information, read
this excerpt from Java Language Specification.
[ March 04, 2005: Message edited by: Yosi Hendarsjah ]