The declaration of the NullObject class is given in Program .
The NullObject class is a concrete class
derived from the Object abstract base class.
The NullObject class is also a singleton class.
I.e., it is a class of which there will only ever be exactly one instance.
The one instance is in fact a static member variable of the class itself.
In order to ensure that no other instances can be created,
the default constructor is declared to be a private member function.
The static member function Instance returns a reference
to the one and only NullObject instance.
Program: NullObject Class Definition