Q60
What will be the output of the following Java code? class A int i; void display() System.out.println(i); class B extends A int j; void display() System.out.println(j); class method_overriding public static void main(String args[]) B obj = new B(); obj.i=1; obj.j=2; obj.display();
A.
0
B.
1
C.
2
AnswerD.
Compilation Error
Answer: Option C
Solution
Answer: Option C
No explanation is given for this question Let's Discuss on Board