what is the reason for the following output of overloaded function? [duplicate]

Clash Royale CLAN TAG#URR8PPP
what is the reason for the following output of overloaded function? [duplicate]
This question already has an answer here:
I was asked the output of this question in an interview, though I answered correctly I am not able to figure out the exact reason
class Main
void hello(Object obj)
System.out.println("i am object");
void hello(String str)
System.out.println("i am String");
public static void main(String args)
Main m = new Main();
m.hello(null);
Output
i am String
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
Please search before posting. More about searching here.
– T.J. Crowder
Aug 10 at 14:13