According to the
Java language specification:
If more than one member method is both accessible and applicable to a method invocation ... The Java programming language uses the rule that the most specific method is chosen.
Because String is a subclass of Object, the version with String is considered more specific.
Try adding the following method:
What do you think will happen now?