Question: Public Class Mystery { Private Static Mystery Instance = Null; Protected Mystery() { // Exists Only To Defeat Instantiation. } Public Static Mystery GetInstance() {
Public Class Mystery { Private Static Mystery Instance = Null; Protected Mystery() { // Exists Only To Defeat Instantiation. } Public Static Mystery GetInstance() { If(Instance == Null) { Instance = New Mystery(); } Return Instance; } }

Pick ONE Option Factory Design Pattern Strategy Pattern Singleton Facade Design Pattern

public class Mystery { private static Mystery instance = null; protected Mystery () { } // Exists only to defeat instantiation. public static Mystery getInstance() { if (instance == null) { } instance = new Mystery(); return instance; } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
