This is the actual way of initializing the data members. Normally constructors have two phases, namely initialization and computation.
/* Initialization */
explicit Box(double l, double w, double h): Rectangle(l, w), height(h)
And whatever you do inside { }, that comes under computation phase.
Even if you don't write a initialize list in your code the compiler puts hidden code to initialize your data members. So if you write
explicit Box(double l, double w, double h):Rectangle(l, w)
{
height = h; /* re-assigning value */
}
It means you are just assigning values to which are all ready been initialized.
explicit Box(double l, double w, double h): Rectangle(l, w), height(h)
This type of initialization is mandatory when you have constant or reference data members in your class. Because you can't assign values to them inside the constructor body i.e. inside { }