The implementation is the most language-dependent part of the pattern.
The trick to the Singleton is threefold:
A nonpublic constructor so that arbitrary instances of the class can not be created.
A field that holds a single unique instance of the class.
A method that returns a reference (Java) or a pointer (C++) to the field.
Click on the link below to perform the
Singleton Pattern - Exercise