Singleton Design Pattern
Singleton Design Pattern
The Singleton pattern is a creational design pattern that allows only one
instance of a class to be created and provides a global point of access to
that instance. This pattern is useful when only one object is needed to
coordinate actions across the system. It is also helpful when there is a
need to restrict the instantiation of a class to one object.
```
public class Singleton {
private static Singleton instance;
private Singleton() {
// private constructor to prevent external instantiation
}