What will be the result of the program execution?

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"; } }
Explanation
Polymorphism is not applicable to the static methods

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback