Which design pattern is used to ensure that only one instance of a class is created and provides a global point of access to that instance?
- Factory Method
- Observer
- Prototype
- Singleton
The Singleton design pattern is used to ensure that only one instance of a class is created and provides a global point of access to that instance. This is particularly useful when exactly one object is needed to coordinate actions across the system.
Loading...
Related Quiz
- What is a Pod in the context of Kubernetes?
- In a pull request, you notice that a colleague has introduced a security vulnerability. How would you handle this issue to ensure the security of the codebase?
- What is the primary goal of CI/CD in software development?
- What is the purpose of a database schema in database design?
- Role-based access control (RBAC) is a common method for _______ in large systems.