Menu
Question Index
...

What will be the output of the following program?

class Bye extends Hello
{
    Bye()
    {
        System.out.print("Good Bye!");
    }
    public static void main(String args[])
    {
        new Bye();
    }
}
class Hi
{
    Hi()
    {
        System.out.print("Hi...!");
    }
}
class Hello extends Hi
{
    Hello()
    {
        System.out.print("Hello ");
    }
}


Good Bye!
Hi...!Hello Good Bye!
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