CS FundamentalsEasyWipro · Accenture pattern

Which design pattern ensures that a class has only one instance and provides a global point of access to it?

  1. A. Factory Method
  2. B. Singleton
  3. C. Observer
  4. D. Prototype

Correct answer: B. Singleton

Singleton restricts instantiation to one object (private constructor + static accessor). Prototype is the opposite idea: creating new objects by cloning.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic