I always thought that constructors aren\'t inherited, but look at this code:
class Parent {
Parent() {
S
You write:
It shows that Child inherited constructor.
Constructors can not be inherited. Classes can be inherited, so Child does not inherit any constructor. Child inherits class Parent. Parent inherits class Object. When you call the Child constructor, automatically an Object constructor is called and then a Parent constructor, before the code of the Child constructor is run.
This why you get this result:
S1
S2