Everything that you see here is called a constructor chain. Now what is a chain of constructors:
The constructor chain is inherited. Subclassing the first constructor method is to call its constructor the superclass method. This ensures that the creation of the subclass object begins with the initialization of the classes above it in the chain inheritance.
. , . , . . ()
. , Child javac:
class Child extends Parent
{
Child()
{
super();//automatically inserted here in .class file of Child
System.out.println("S2");
}
}
:
Parent()
{
super();//Constructor of Object class
System.out.println("S1");
}
:
S1 //output from constructor of super class Parent
S2 //output from constructor of child Class Child