Question
What will be the output?class A{ int i = 10; public void printValue(){ System.out.print("Value-A"); }}class B extends A{ int i = 12; public void printValue(){ System.out.print("Value-B"); }}public class Test{ public static void main(String args[]){ A a = new B(); a.printValue(); System.out.print(a.i); }}
Answer: Option B
Submit Your Solution Below and Earn Points !
Submit Your Solution Below and Earn Points !
More Questions on This Topic :
Question 4. ____________ method cannot be overridden.....
Submit Solution