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.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *