The below code has compilation issue,can some one explain ?How null is treated in this case? All Wrapper class giving the same issue.
public class MyTest {
public static void main(String[] args) {
new MyTest().hello(null);
}
public void hello(Object o){
System.out.println("object");
}
public void hello(Boolean o){
System.out.println("Boolean");
}
public void hello(Double o){
System.out.println("Double");
}
}
All Wrapper class giving the same issue:
The method hello(Object) is ambiguous for the type MyTest class.