Whenever there is an ambiguous function call, Java will always attempt to call the most specific class available. In this case, since null matches both Object and String, and since String inherits from Object, String is the most specific. Note that, if you had "sibling" methods - eg. you added "amethod(Integer x)", then there would be no clear-cut 'most specific' method so you would get an error.
Joined: Jan 04, 2001
Thanks Rob i got u infact i have got the same concept in my mind but thanks for Explanation.