Menu
Question Index
...

What will be the output of the following program?

public class Baseclass
{
    Baseclass()
    {
        System.out.print("Base class ");
    }
    public static void main(String args[]) {
        new ChildClass();
    }
}
class ChildClass extends Baseclass
{
    ChildClass()
    {
        System.out.print("Child class");
    }
}


Base class Child class
Child class Base class
Compilation Error
Runtime Error

Doubts

Problems

Topic: Java Class Inheritance

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App