I have this following code and I need some clarification regarding the overloading concept.
class Overload{
static void print(Object o){
System.out.println("object");
}
static void print(String s){
System.out.println("string");
}
public static void main(String...args){
print("Hello");
}
}
when I execute this, the output is String. Eventhough object is the super class, why does it display string instead of object?
thanks in advance