C# (Sharp) Programming Language Question:
Which .Gang of Four. design pattern is shown below?

Answers:
Answer #1
<pre> public class A {
private A instance;
private A() {
}
public
static A Instance {
get
{
if ( A == null )
A = new A();
return instance;
}
}
}
</pre>
1. Factory
2. Abstract Factory
3. Singleton
4. Builder
<pre> public class A {
private A instance;
private A() {
}
public
static A Instance {
get
{
if ( A == null )
A = new A();
return instance;
}
}
}
</pre>
1. Factory
2. Abstract Factory
3. Singleton
4. Builder
Answer #2
3
3