LogiQuest
Back to Inheritance and Polymorphism
12

What is the output of the following program?

public class Main {
    public static void main(String[] args) {
        new C();
        System.out.println();
    }
}
class A { A() { System.out.print("A"); } }
class B extends A { B() { System.out.print("B"); } }
class C extends B { C() { System.out.print("C"); } }
Easy

Discussion (0)

  • No discussion yet. Ask a doubt or share a shortcut.

Log in to join the discussion.