Answer:
Check the explanation
Step-by-step explanation:
// Code to copy
public class ConstChain1 {
public static void main(String[] args)
{
new SubClass();
System.out.println();
new SubClass(1);
}
}
class SuperClass{
public SuperClass() {
System.out.println("D");
}
public SuperClass(int i) {
System.out.println("C");
}
}
class SubClass extends SuperClass{
public SubClass() {
this(10);
System.out.println("B");
}
public SubClass(int i) {
super(i);
System.out.println("A");
}
}
Step-by-step explanation:
Now each time when a object of a subclass is been created it's super class constructor will be executed first then only subclass object is created by executing it's constructor.