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("Alpha");
    }
}
class Base
{  
    Base()
    {
        System.out.println("Base");
    }
}


AlphaBase
Base
Alpha
Base
Base
AlphaBase
AlphaBase
Base
BaseAlpha

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