LogiQuest
Back to Inheritance and Polymorphism
13

What is the output of the following program?

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

Discussion (0)

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

Log in to join the discussion.

What is the output of the following… | LogiQuest