Hi,
I am confused regarding the output of the following code:
Class ABC{
ABC(Object o){
System.out.println("Object");
}
ABC(
String s){
System.out.println("String");
}
public static void main(String[] args){
new ABC(null);
}
}
When i am running this class i am getting the output as
>String
Can anyone explain me why the constructor with argument as Object is getting neglected when i am calling the constructor with argument value as null?
Any help would be appreciated.
Thanks,
Puneet