Solution :
With super()
, a superclass no-argument constructor is called and with super(parameter list)
, a superclass constructor with the matching parameter list is called.
If a super class does not have the no-argument constructor then you will get the compile-time error. Object
does have such the constructor, so if Object
is a only superclass then there is no problem.
If the subclass constructor invokes the constructor of its superclass, either explicitly or implicitly, you might think that there will be the whole chain of the constructors called, all the way back to a constructor of Object
. In fact, this is a case. It is called the constructor chaining, and you must be aware of it when there is such long line of class descent.