# Construction

Take a `Tariff` holding the three rates from `ParkingLotApi`. In C++ that is one constructor,
an initialiser list, and default arguments for the rates nobody changes. Java has none of them.

There are no initialiser lists. Every `final` field is assigned in the constructor body, and
`javac` proves the assignment happens exactly once on every path. Return early from a branch
and you get `variable truckMinor might not have been initialized`. Assign twice and you get
`variable carMinor might already have been assigned`.

Both messages are one guarantee: a `Tariff` that exists has its rates. The guarantee sits on
the field, so it travels with the object. A `const Tariff&` constrains that reference only,
and another holder may have a non-const one. `final` fields plus a private constructor is
what makes a Java object shareable without a copy.

There are no default arguments either. The replacement is a second constructor delegating with
`this(...)`, and it runs out the moment two defaults have the same type: two `(int, int)`
constructors will not compile. `LotConfig.withGraceMinutes(10, 15)` and
`LotConfig.withFreeHours(10, 1)` both do, because a static factory has a name. It also rejects
bad input before an object exists, and can return a cached instance.

Then the ordering, which C++ has no analogue for. `super()` runs first, then field
initialisers top to bottom, then the constructor body. A base constructor calling an
overridable method reaches the subclass override while every subclass field is still null.
