Multiple choice technology architecture

Need to create a class, which will return the same instance whenever requested

  1. Singleton pattern

  2. One Instance pattern

  3. No such class be formed

  4. Static classes are one instance classess

  5. None of the above

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The Singleton pattern ensures a class has only one instance and provides a global point of access to that instance. It involves a private constructor, a static variable to hold the single instance, and a static method that returns this instance (creating it if necessary). 'One Instance' and 'Static classes' are not recognized design patterns for this purpose.