I have a dummy program in java given below-
public class DummyTest {
public static void main(String[] args) {
hungry(null);
}
public static void hungry(Object o){
System.out.println("object");
}
public static void hungry(String s){
System.out.println("string");
}
}
this program returns prints string
. please tell me the concept that why it prints string
and not object
.