1.

Which pattern prevents one from creating more than one instance of a variable?(a) Factory Method(b) Singleton(c) Observer(d) None of the mentionedThe question was asked during an interview.I'd like to ask this question from Software Design Pattern topic in chapter Design and Implementation of Software Engineering

Answer»

The correct choice is (b) SINGLETON

The explanation is: 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.



Discussion

No Comment Found

Related InterviewSolutions