LogiQuest
Back to Inheritance and Polymorphism
2

What is the output of the following program?

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

Discussion (0)

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

Log in to join the discussion.