Home > .net, c# > Simple way to create a singleton

Simple way to create a singleton

Found this is microsoft official line on creating a singleton, much simpler than the normal GOF way :)

// .NET Singleton
sealed class Singleton
{
private Singleton() {}
public static readonly Singleton Instance = new Singleton();
}

Categories: .net, c# Tags:
  1. No comments yet.
  1. No trackbacks yet.