Why the below program gives o/p as
String version & not
Object version
If I change Object to Integer or StringBuffer it gives compiler error reference to method is ambiguous.I can't understand why it
is so ?
public class
Test {
public void method(Object o)
{
System.out.println("Object version");
}
public void method(String s)
{
System.out.println("String version");
}
public static void main(String args[])
{
Test test=new Test();
test.method(null);
}
}