C#
Public
Singleton Pattern in C#
Defines a singleton class with a static instance method ensuring a single object and a method returning a fixed integer.
#beadando
C#
namespace HF10
{
internal class S : ISize
{
private static S instance = null;
private S()
{
}
public static S Instance()
{
if (instance == null)
{
instance = new S();
}
return instance;
}
public int Multi()
{
return 1;
}
}
}