I am new to Java Programming. Can anyone please explain me why the program outputs - "fa la" even though the static method is overridden. I read that static methods can't be overridden in Java? Please correct me if I am wrong.
public class Tenor extends Singer {
public static String sing() {
return "fa";
}
public static void main(String[] args) {
Tenor t = new Tenor();
Singer s = new Tenor();
System.out.println(t.sing() + " " + s.sing());
}
}
class Singer {
public static String sing() {
return "la";
}
}