But first of all, I would like to insist on something.
It is not necessary
to have supplementary fields in the subclass.
For example, if we have a square,
which is a certain sort of rectangle,
a square is a rectangle where the width is equal to its height,
then we will not introduce into the subclass Carre (TN: = "square"),
extra data members.
But we could anyway, in the constructor of Carre,
and we would have to do it here,
in this constructor that doesn't
add any fields,
call the
constructor of the superclass.
Look at this example in detail.
We say that a square is a rectangle,
in the class Rectangle, we have as usual,
data members for width and height,
which we inherited from the class Carre
and we would simply say a square is a rectangle
whose width equals its height.
And we would not add or change anything else in Carre.
So, we would simply declare the class Carre
as a subclass of Rectangle,
and not add anything in particular.
I will come back with a final remark in an instant.
Simply,
we will force the constructor here to take one unique dimension,
the length of the side of a square,
and to call the constructor of the superclass