What will be the output of this program?

Last Updated :
Discuss
Comments

What will be the output of this program?

Java
abstract class Parent {
    abstract void show();
}
class Child extends Parent {
    void show() {
        System.out.println("Child class method");
    }
}
public class Main {
    public static void main(String[] args) {
        Parent p = new Child();
        p.show();
    }
}


Compilation Error

Runtime Error


Child class method

No Output

Share your thoughts in the comments