Also, note that, if you have your 2nd method take a parameter that is a super type of String, like Object, then there would be no ambiguity, because compiler will now choose the most specific one, i.e., String argument.

So, ambiguity only occurs, when you have two methods with types that are not in the same inheritance hierarchy.

Only your doStuff(String) method can take a NULL argument... the primitive int can never be null. If you had a second method overload that passed an object, you would no longer be able to pass null as a parameter for that method.

The part about the second overload is not correct. If he had another overload that took Object for example, the overload taking String would be chosen as being most specific. If he only had overloads of incommensurable types, such as String and Integer, he would get a compilation error.
–
EJPNov 29 '12 at 21:51

Good catch - I didn't mean object as in Object, and I also didn't know that. Thanks!
–
LJ2Nov 29 '12 at 21:58