Ensure a class only has one instance, and provide a global point of access to it.
- Normal Singleton
- Eager Singleton
- Double Lock Singleton
- Bill Push Singleton
- Static Block Singleton
- Enum Based Singleton
most commonly used design pattern
Applications
- when managing access to a resource which is shared by the entire application
- Singleton pattern is used for logging, drivers objects, caching, and thread pool
- Real World Example : sharing a single washing machine among all the residents in a hotel or sharing a single appliance like refrigerator among all the family members
