487Software EngineeringMedium
Which pattern prevents one from creating more than one instance of a variable?
AFactory Method
BNone of the mentioned
CObserver
DSingleton
Correct answer
D. Singleton
Explanation
Explanation: In singleton pattern, the class itself is made responsible for keeping track of its instance.Thus it ensures that no more than one instance is created.