Passing null to the Overloaded methods [duplicate]
问题 This question already has answers here : Method Overloading for null argument (7 answers) Closed 3 years ago . I am confused with the Output of the following two programs. When I'm only having two methods with parameters as String and Object in Program 1 it gives me output as String . But when I add a new method with parameter as Integer in Program 2 it won't compile and gives error as The method nullTest(Object) is ambiguous for the type testNull Program 1 : package onkartest; public class