10
What is the output of the following program?
public class Main {
public static void main(String[] args) {
A a = new B();
System.out.println(a.x);
}
}
class A { int x = 1; }
class B extends A { int x = 2; }Medium