196.
Which design pattern is shown below?
public class A
{
private static A instance;
private A() {}
public static A Instance
{
get
{
if (instance == null)
{
instance = new A();
}
return instance;
}
}
}
View Description
In software engineering, the singleton pattern is a design pattern used to implement the mathematical concept of a singleton, by restricting the instantiation of a class to one object. This is useful when exactly one object is needed to coordinate actions across the system