Menu
Question Index
...

What will be the output of the following program?

class OutPut
{
    public static void main(String[] args)
    {
        new Alpha();
        new Base();
    }
}
class Alpha extends Base
{
    Alpha()
    {
        System.out.print("Base");
    }
}
class Base
{  
    Base()
    {
        System.out.println("Base");
    }
}


BaseBase
Base
Base
Base
Base
BaseBase
BaseBase
Compilation Error

Doubts

Problems

Topic: Inheritance And Constructors In Java

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App