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

The name of the pictureThe name of the pictureThe name of the pictureClash 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




Popular posts from this blog

make 2 or more post in bootsrap

Store custom data using WC_Cart add_to_cart() method in Woocommerce 3

Firebase Auth - with Email and Password - Check user already registered