What does the method print

Report a typo

Here is a hierarchy of four classes: A, B, C, and D.

class A {

    public void method() {
        System.out.println("A");
    }
}

class B extends A {

    public void method() {
        System.out.println("B");
    }
}

class C extends B {

}

class D extends C {

    public void method() {
        super.method();
    }
}

What does this code print? Enter the resulting character.

A a = new D();
a.method();
Enter a short text
___

Create a free account to access the full topic