Call Super Class Constructors - Java Quiz Question


What will be the output of the following program?

public class Example {
    public static void main(String args[]) {
        A a = new A(10);
        B b = new B(20, 30);
        System.out.println(a.i);
        System.out.println(b.i);
    }
}
class A {
    int i;
    A(int i) {
        this.i = i;
    }
}
class B extends A {
    int j;
    B(int i, int j) {
        super(i);
        this.j = j;
    }
}


A
10
10
B
10
30
C
10
0
D
Some other output
E
Compilation Error or Runtime Error