SE450: The SINGLETON Pattern [36/55] Previous pageContentsNext page

Solution

  1. Define a class with a private constructor.
  2. The class constructs a single instance of itself.
  3. Supply a static method that returns a reference to the single instance.

Previous pageContentsNext page