This loads the package.
The next example defines a simple set of classes.
By default, fields are only searched for relative to the current calling context. The first access to a is relative to the object, while the second is relative to f that is a member of the base class.
We now force polymorphism for nonprivate fields. The
Override qualifier is used to emphasize that functionality of a parent class is changed. We must clear
child before, because automatic regeneration of it during the redefinition of
base is not consistent with the new
base.
Accordingly, the object's class determines where to search for a field.