Question:What is the output of the given program?
public class Test129 {
        public static void main(String[] args) {
                A a = new A2();
                B b = new B2();
                System.out.println(a.a + "" + b.b);
        }
}
class A { int a = 1; }
class A2 extends A { int a = 2; }
class B { public int b = 1; }
class B2 extends B { public int b = 2; }
 

A 1 

B 2 

C 11 

D 22 

+ Answer
+ Report
Total Preview: 679

Copyright © 2024. Powered by Intellect Software Ltd