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

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

Answer & Solution
Correct Answer: Option B
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.