ExamVeda
Login
Home
This question belongs to Java Program Inheritence
Inheritence
?

What will be the output of the following Java program?
class A 
{
    public int i;
    public int j;
    A() 
    {
        i = 1;
        j = 2;
}
}    
class B extends A 
{
    int a;
    B() 
    {
        super();
    } 
}    
class super_use 
{
    public static void main(String args[])
    {
        B obj = new B();
        System.out.println(obj.i + " " + obj.j)     
    }
}

Answer & Solution
Correct Answer: Option A
Let's discuss the solution. Join the discussion
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.