Menu
Question Index
...

What will be the output of the following program?

class OutPut
{
    public static void main(String [] args)
    {
        Count t = new Count();
        t.count();
    }
}

class Count extends Count2
{
    Count()
    {

    }
}
class Count2
{
    void count()
    {
        System.out.print("Output = ");

        for (int x = 0; x < 7; x++,x++ )
        {
            System.out.print(" " + x);
        }
    }
}


Output = 0 2 4 6
Output =
Compilation Error
Runtime 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