Examveda
Examveda

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

A. 2 2

B. 3 3

C. Runtime Error

D. Compilation Error

Answer: Option D


This Question Belongs to Java Program >> Overriding And Overloading

Join The Discussion

Related Questions on Overriding and Overloading