From https://codegym.cc/quests/lectures/questcore.level05.lecture03 :
"In the second case, there won't be any compilation errors and void print(String s) will be called, which is somewhat not obvious:
public class Cat {
public static void print(Object o) {
System.out.println(o);
}
public static void print(String s) {
System.out.println(s);
}
public static void main(String[] args) {
Cat.print(1);
Cat.print(null);
}
}
Why the print(String s) method will be called?
The null-reference can not belong to the Object, only to the String or the Integer?!...
In the previous example in the lecture we needed to do this:
Cat.print((String)null);
In this example why don't we need to do the same?