Even if you comment the method that takes in a
String argument it would work. The reason is that null is a valid argument for Object, String and StringBuffer. But the method with closest match is chosen over other methods for execution. Now when we have methods that accept Object type and String type of argument. String is more specific so the compiler knows that String method should be used. But when you have two or more completely different things(no where related in the class hierarchy) as the argumnet it is impossible for the compiler to determine which method should be called. Hence the error.